org.milyn.persistence
Class EntityLocator
java.lang.Object
org.milyn.persistence.EntityLocator
- All Implemented Interfaces:
- org.milyn.delivery.ContentHandler, org.milyn.delivery.dom.DOMElementVisitor, org.milyn.delivery.dom.DOMVisitAfter, org.milyn.delivery.dom.DOMVisitBefore, org.milyn.delivery.dom.DOMVisitor, org.milyn.delivery.ordering.Consumer, org.milyn.delivery.ordering.Producer, org.milyn.delivery.sax.SAXVisitAfter, org.milyn.delivery.sax.SAXVisitBefore, org.milyn.delivery.sax.SAXVisitor, org.milyn.delivery.Visitor
public class EntityLocator
- extends Object
- implements org.milyn.delivery.dom.DOMElementVisitor, org.milyn.delivery.sax.SAXVisitBefore, org.milyn.delivery.sax.SAXVisitAfter, org.milyn.delivery.ordering.Producer, org.milyn.delivery.ordering.Consumer
DAO Locator
This DAO locator uses lookup methods or methods that accept a query to
lookup entities from a data source. In case of a query it depends on the DAO
or the Scribe adapter what the query language is.
Configuration
Namespace: http://www.milyn.org/xsd/smooks/persistence-1.2.xsd
Element: locator
Attributes:
Take a look at the schema for all the information on the configurations parameters.
Configuration Example
<?xml version="1.0"?>
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:dao="http://www.milyn.org/xsd/smooks/persistence-1.2.xsd">
<dao:locator beanId="entity" lookup="something" lookupOnElement="b">
<dao:params>
<dao:value name="arg1" decoder="Integer" data="c" />
<dao:expression name="arg2">dAnde.d + dAnde.e</dao:expression>
<dao:wiring name="arg3" beanIdRef="dAnde" wireOnElement="e" />
<dao:value name="arg4" data="f/@name" />
<dao:value name="arg5" decoder="Date" data="g" >
<dao:decodeParam name="format">yyyy-MM-dd HH:mm:ss</dao:decodeParam>
</dao:value>
</dao:params>
</dao:locator>
<dao:locator beanId="customer" lookupOnElement="b">
<dao:query>from Customer c where c.id = :arg1</dao:query>
<dao:params>
<dao:value name="arg1" decoder="Integer" data="c" />
</dao:params>
</dao:locator>
</smooks-resource-list>
- Author:
- maurice.zeijen@smies.com
|
Method Summary |
boolean |
consumes(Object object)
|
Set<? extends Object> |
getProducts()
|
void |
initialize()
|
void |
initParameterContainer(org.milyn.container.ExecutionContext executionContext)
|
void |
lookup(org.milyn.container.ExecutionContext executionContext,
org.milyn.delivery.Fragment source)
|
Object |
lookup(Object dao,
org.milyn.container.ExecutionContext executionContext)
|
void |
visitAfter(Element element,
org.milyn.container.ExecutionContext executionContext)
|
void |
visitAfter(org.milyn.delivery.sax.SAXElement element,
org.milyn.container.ExecutionContext executionContext)
|
void |
visitBefore(Element element,
org.milyn.container.ExecutionContext executionContext)
|
void |
visitBefore(org.milyn.delivery.sax.SAXElement element,
org.milyn.container.ExecutionContext executionContext)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EntityLocator
public EntityLocator()
initialize
@Initialize
public void initialize()
throws org.milyn.cdr.SmooksConfigurationException
- Throws:
org.milyn.cdr.SmooksConfigurationException
getProducts
public Set<? extends Object> getProducts()
- Specified by:
getProducts in interface org.milyn.delivery.ordering.Producer
consumes
public boolean consumes(Object object)
- Specified by:
consumes in interface org.milyn.delivery.ordering.Consumer
visitBefore
public void visitBefore(Element element,
org.milyn.container.ExecutionContext executionContext)
throws org.milyn.SmooksException
- Specified by:
visitBefore in interface org.milyn.delivery.dom.DOMVisitBefore
- Throws:
org.milyn.SmooksException
visitBefore
public void visitBefore(org.milyn.delivery.sax.SAXElement element,
org.milyn.container.ExecutionContext executionContext)
throws org.milyn.SmooksException,
IOException
- Specified by:
visitBefore in interface org.milyn.delivery.sax.SAXVisitBefore
- Throws:
org.milyn.SmooksException
IOException
visitAfter
public void visitAfter(Element element,
org.milyn.container.ExecutionContext executionContext)
throws org.milyn.SmooksException
- Specified by:
visitAfter in interface org.milyn.delivery.dom.DOMVisitAfter
- Throws:
org.milyn.SmooksException
visitAfter
public void visitAfter(org.milyn.delivery.sax.SAXElement element,
org.milyn.container.ExecutionContext executionContext)
throws org.milyn.SmooksException,
IOException
- Specified by:
visitAfter in interface org.milyn.delivery.sax.SAXVisitAfter
- Throws:
org.milyn.SmooksException
IOException
initParameterContainer
public void initParameterContainer(org.milyn.container.ExecutionContext executionContext)
lookup
public void lookup(org.milyn.container.ExecutionContext executionContext,
org.milyn.delivery.Fragment source)
lookup
public Object lookup(Object dao,
org.milyn.container.ExecutionContext executionContext)
Copyright © 2018. All rights reserved.