public class JPAExecuteTransformer extends EntityManagerLookupAware implements org.apache.commons.collections.Transformer, Serializable
Collection
and a fieldMapping
is provided then, it expects the input to be an Object and it can take parameter names defined and map it to the fields in the mapping.
TODO: Add Unit test caseModifier and Type | Field and Description |
---|---|
protected Map<String,?> |
fieldMapping
Map from query param name to field name or Transformer that will act on input to get param value.
|
protected String |
query |
protected boolean |
queryIsNative
If the Query is to be fired in JPA or native DB SQL language
|
Constructor and Description |
---|
JPAExecuteTransformer() |
JPAExecuteTransformer(String query) |
Modifier and Type | Method and Description |
---|---|
Map<String,?> |
getFieldMapping()
Map from query param name to field name or Transformer that will act on input to get param value.
|
String |
getQuery() |
boolean |
isQueryIsNative()
If the Query is to be fired in JPA or native DB SQL language
|
void |
setFieldMapping(Map<String,?> fieldMapping)
Map from query param name to field name or Transformer that will act on input to get param value.
|
void |
setQuery(String query) |
void |
setQueryIsNative(boolean queryIsNative)
If the Query is to be fired in JPA or native DB SQL language
|
Object |
transform(Object input) |
getEntityManager, getEntityManagerProvider, setEntityManager, setEntityManagerProvider, updateContext
protected String query
protected boolean queryIsNative
public JPAExecuteTransformer()
public JPAExecuteTransformer(String query)
@Transactional(readOnly=false) public Object transform(Object input)
transform
in interface org.apache.commons.collections.Transformer
public String getQuery()
public void setQuery(String query)
public boolean isQueryIsNative()
public void setQueryIsNative(boolean queryIsNative)
public Map<String,?> getFieldMapping()
Copyright © 2018. All rights reserved.