ENTITY
- public class QueryResultArrayToEntityTransformer<ENTITY> extends ObjectArrayToEntityTransformer<ENTITY> implements QueryOptimizer
ObjectArrayToEntityTransformer
that also provides a replaceEntityString(String, String)
to prepare
the actual Query to return the result array in the expected format as defined by AbstractEntityTransformer.getColumnFieldMapping()
Process.Event, Process.EventPoint
type
columnFieldMapping, idempotent, mode, modesSupported, nestedObjectInitMap, nonAssociatedMappers
listeners, processState
Constructor and Description |
---|
QueryResultArrayToEntityTransformer() |
QueryResultArrayToEntityTransformer(Class<ENTITY> type,
List<String> fieldNames,
boolean inverse) |
QueryResultArrayToEntityTransformer(Class<ENTITY> type,
Map<Integer,Mapper> columnFieldMapping) |
QueryResultArrayToEntityTransformer(Class<ENTITY> type,
org.apache.commons.collections.Transformer fieldNamesTransformer,
Object fieldNames,
boolean inverse) |
Modifier and Type | Method and Description |
---|---|
String |
getOverrideFromClause()
Optional override of FROM clause over the default Query From to be optimized by specifying one.
|
void |
morphQuery(Query q)
Converts the
AbstractEntityTransformer.getColumnFieldMapping() into the Query.setIncludedFields(List) |
String |
replaceEntityString(String query,
String entityAlias)
For a given query String, replace entity with the equivalent fields in the order specified in
AbstractEntityTransformer.getColumnFieldMapping() |
void |
setOverrideFromClause(String overrideFromClause)
Optional override of FROM clause over the default Query From to be optimized by specifying one.
|
Object |
transform(Object input)
Work Horse method that does all the conversion using
Mapper s. |
getColumnIndex, getColumns, getDeclaredFields, getTuple, getTupleIndex, getTupleIndexFromCol, getType, getValue, init, setType
identifyNode
consumeIntermediateObjects, getColumnFieldMapping, getEntityAccessTransformer, getMode, getModesSupported, getNestedObjectInitMap, getNonAssiciatedMappers, getNonAssociatedMappers, getValue, init, isIdempotent, nestedInit, processValue, setColumnFieldMapping, setEntity, setEntityAccessTransformer, setIdempotent, setMode, setModesSupported, setNestedObjectInitMap, setNonAssociatedMappers
addListener, getListeners, onChangeHandler, setListeners
public QueryResultArrayToEntityTransformer()
public QueryResultArrayToEntityTransformer(Class<ENTITY> type, List<String> fieldNames, boolean inverse)
public QueryResultArrayToEntityTransformer(Class<ENTITY> type, Map<Integer,Mapper> columnFieldMapping)
public QueryResultArrayToEntityTransformer(Class<ENTITY> type, org.apache.commons.collections.Transformer fieldNamesTransformer, Object fieldNames, boolean inverse)
type
- as Entity typefieldNamesTransformer
- as Transformer
that will process the fieldNames in any typefieldNames
- in any type that the fieldNamesTransformer can transform into a List
inverse
- as boolean. If true the fieldNames become excluded ratehr than included.public Object transform(Object input)
AbstractTupleToEntityTransformer
Mapper
s.
transform
in interface QueryOptimizer
transform
in interface org.apache.commons.collections.Transformer
transform
in class AbstractTupleToEntityTransformer<Object[],com.neurosys.etl.common.transformers.ObjectArrayToEntityTransformer.Cell,ENTITY>
public String replaceEntityString(String query, String entityAlias)
AbstractEntityTransformer.getColumnFieldMapping()
replaceEntityString
in interface QueryOptimizer
query
- as String originally expected to return ENTITYentityAlias
- as the variable representing the entity in the query in the SELECT clausepublic void morphQuery(Query q)
AbstractEntityTransformer.getColumnFieldMapping()
into the Query.setIncludedFields(List)
morphQuery
in interface QueryOptimizer
q
- as Querypublic String getOverrideFromClause()
public void setOverrideFromClause(String overrideFromClause)
Copyright © 2018. All rights reserved.