org.milyn.persistence
Class EntityDeleter
java.lang.Object
org.milyn.persistence.EntityDeleter
- All Implemented Interfaces:
- ContentHandler, DOMElementVisitor, DOMVisitAfter, DOMVisitBefore, DOMVisitor, Consumer, Producer, SAXVisitAfter, SAXVisitBefore, SAXVisitor, Visitor
@VisitBeforeIf(condition="parameters.containsKey(\'deleteBefore\') && parameters.deleteBefore.value == \'true\'")
@VisitAfterIf(condition="!parameters.containsKey(\'deleteBefore\') || parameters.deleteBefore.value != \'true\'")
public class EntityDeleter
- extends Object
- implements DOMElementVisitor, SAXVisitBefore, SAXVisitAfter, Consumer, Producer
DAO Deleter
This DAO deleter calls the delete method of a DAO, using a entity bean from
the bean context as parameter.
Configuration
Namespace: http://www.milyn.org/xsd/smooks/persistence-1.2.xsd
Element: deleter
Attributes:
- beanId : The id under which the entity bean is bound in the bean context. (required)
- deleteOnElement : The element selector to select the element when the delete should execute. (required)
- dao : The name of the DAO that will be used. If it is not set then the default DAO is used. (optional)
- name* : The name of the insert method. Depending of the adapter this can mean different things.
For instance when using annotated DAO's you can name the methods and target them with this property, but
when using the Ibatis adapter you set the id of the Ibatis statement in this attribute. (optional)
- deletedBeanId : The bean id under which the deleted bean will be stored. If not set then the deleted
bean will not be stored in bean context. (optional)
- deleteBefore : If the deleter should execute on the 'before' event. (default: false)
* This attribute is not supported by all scribe adapters.
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:deleter dao="dao" name="deleteIt" beanId="toDelete1" deleteOnElement="root" deletedBeanId="deleted" deleteBefore="false" />
</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 |
EntityDeleter
public EntityDeleter()
initialize
@Initialize
public void initialize()
throws SmooksConfigurationException
- Throws:
SmooksConfigurationException
getProducts
public Set<String> getProducts()
- Specified by:
getProducts in interface Producer
consumes
public boolean consumes(Object object)
- Specified by:
consumes in interface Consumer
visitBefore
public void visitBefore(Element element,
ExecutionContext executionContext)
throws SmooksException
- Specified by:
visitBefore in interface DOMVisitBefore
- Throws:
SmooksException
visitAfter
public void visitAfter(Element element,
ExecutionContext executionContext)
throws SmooksException
- Specified by:
visitAfter in interface DOMVisitAfter
- Throws:
SmooksException
visitBefore
public void visitBefore(SAXElement element,
ExecutionContext executionContext)
throws SmooksException,
IOException
- Specified by:
visitBefore in interface SAXVisitBefore
- Throws:
SmooksException
IOException
visitAfter
public void visitAfter(SAXElement element,
ExecutionContext executionContext)
throws SmooksException,
IOException
- Specified by:
visitAfter in interface SAXVisitAfter
- Throws:
SmooksException
IOException
Copyright © 2011. All Rights Reserved.