public class JpaFilter extends InputWrapper implements AfterConsequenceFilter
| Modifier and Type | Field and Description |
|---|---|
static String |
KEY
The default key name to use when placing the entityManager in the action input.
|
static String |
TRANS_KEY
The default key name to use when placing a jpa transaction in the
action input.
|
| Constructor and Description |
|---|
JpaFilter(javax.persistence.EntityManagerFactory factory) |
JpaFilter(javax.persistence.EntityManagerFactory factory,
boolean transactional) |
JpaFilter(String persistenceUnit) |
JpaFilter(String persistenceUnit,
boolean transactional) |
JpaFilter(String persistenceUnit,
boolean transactional,
Map configOverrides) |
JpaFilter(String persistenceUnit,
Map configOverrides) |
| Modifier and Type | Method and Description |
|---|---|
void |
addResultsForRollback(String... results) |
void |
afterConsequence(Action action,
Consequence c,
boolean conseqExecuted,
boolean actionExecuted,
String result) |
void |
destroy()
Gives a chance to the filter to deallocalte any resources before it is destroyed.
|
String |
filter(InvocationChain chain)
Sets the action to get an JPA EntityManager using the pull model.
|
Object |
getValue(String key)
Verifies if the requested object is a JPA EntityManager, return a
JPA EntityManager if it is and return the content of the action's input
if not.
|
void |
setKey(String key)
Sets the action input key to use.
|
void |
setTransactional(boolean transactional) |
void |
setTransactional(boolean transactional,
String transactionKey) |
String |
toString() |
clear, containsKey, containsValue, entries, entrySet, get, getBoolean, getBoolean, getBooleanValue, getBooleanValue, getDate, getDate, getDate, getDouble, getDouble, getDoubleValue, getDoubleValue, getEnum, getEnums, getFloat, getFloat, getFloatValue, getFloatValue, getHeader, getHeaderKeys, getInt, getInt, getInts, getIntValue, getIntValue, getIntValues, getLong, getLong, getLongs, getLongValue, getLongValue, getObject, getObject, getProperty, getRoot, getString, getStrings, getStringValue, getStringValues, has, hasValue, inject, inject, isEmpty, keys, keySet, put, putAll, remove, removeInput, removeValue, setInput, setValue, size, valuespublic static final String KEY
public static final String TRANS_KEY
public JpaFilter(javax.persistence.EntityManagerFactory factory)
public JpaFilter(javax.persistence.EntityManagerFactory factory,
boolean transactional)
public JpaFilter(String persistenceUnit)
public JpaFilter(String persistenceUnit, boolean transactional)
public void setTransactional(boolean transactional)
public void addResultsForRollback(String... results)
public void setTransactional(boolean transactional,
String transactionKey)
public void setKey(String key)
key - The action input key.public String filter(InvocationChain chain) throws Exception
public void afterConsequence(Action action, Consequence c, boolean conseqExecuted, boolean actionExecuted, String result)
afterConsequence in interface AfterConsequenceFilterpublic void destroy()
Filterpublic Object getValue(String key)
getValue in interface InputgetValue in class InputWrapperkey - the name of the parameterCopyright © 2015. All Rights Reserved.