org.milyn.persistence
Class EntityLocator
java.lang.Object
org.milyn.persistence.EntityLocator
- All Implemented Interfaces:
- ContentHandler, DOMElementVisitor, DOMVisitAfter, DOMVisitBefore, DOMVisitor, Consumer, Producer, SAXVisitAfter, SAXVisitBefore, SAXVisitor, Visitor
public class EntityLocator
- extends java.lang.Object
- implements DOMElementVisitor, SAXVisitBefore, SAXVisitAfter, Producer, 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
| 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 SmooksConfigurationException
- Throws:
SmooksConfigurationException
getProducts
public java.util.Set<? extends java.lang.Object> getProducts()
- Specified by:
getProducts in interface Producer
consumes
public boolean consumes(java.lang.Object object)
- Specified by:
consumes in interface Consumer
visitBefore
public void visitBefore(org.w3c.dom.Element element,
ExecutionContext executionContext)
throws SmooksException
- Specified by:
visitBefore in interface DOMVisitBefore
- Throws:
SmooksException
visitBefore
public void visitBefore(SAXElement element,
ExecutionContext executionContext)
throws SmooksException,
java.io.IOException
- Specified by:
visitBefore in interface SAXVisitBefore
- Throws:
SmooksException
java.io.IOException
visitAfter
public void visitAfter(org.w3c.dom.Element element,
ExecutionContext executionContext)
throws SmooksException
- Specified by:
visitAfter in interface DOMVisitAfter
- Throws:
SmooksException
visitAfter
public void visitAfter(SAXElement element,
ExecutionContext executionContext)
throws SmooksException,
java.io.IOException
- Specified by:
visitAfter in interface SAXVisitAfter
- Throws:
SmooksException
java.io.IOException
initParameterContainer
public void initParameterContainer(ExecutionContext executionContext)
lookup
public void lookup(ExecutionContext executionContext,
Fragment source)
lookup
public java.lang.Object lookup(java.lang.Object dao,
ExecutionContext executionContext)
Copyright © 2011. All Rights Reserved.