E - as input EntityT - as return typepublic abstract class ODBQueryTransformer<E,T> extends Object implements UpdatableContext<com.orientechnologies.orient.core.db.OPartitionedDatabasePool>, QueryTransformer, Function<E,List<T>>, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected com.orientechnologies.orient.core.db.OPartitionedDatabasePool |
connectionPool
Document database Connection Pool
|
protected boolean |
expectSingleResult
If true it will attempt to return only 1 Object or null if no match to query
One should use the LIMIT keyword in query when setting this to true. |
protected Map<String,?> |
fieldMapping
Map from query param name to field name or Transformer that will act on input to get param value.
|
protected com.orientechnologies.orient.core.db.ODatabase |
lastConnection |
protected boolean |
paramAsSingleInput
If true, will take whole input to transformer as a single parameter and pass it in query.
|
protected String |
query
Orientdb Query to process
|
| Constructor and Description |
|---|
ODBQueryTransformer() |
ODBQueryTransformer(ODBQueryTransformer t) |
ODBQueryTransformer(String query,
com.orientechnologies.orient.core.db.OPartitionedDatabasePool connectionPool) |
| Modifier and Type | Method and Description |
|---|---|
List<T> |
apply(E input) |
void |
close() |
protected abstract com.orientechnologies.orient.core.db.ODatabase<T> |
getConnection() |
com.orientechnologies.orient.core.db.OPartitionedDatabasePool |
getConnectionPool() |
Map<String,?> |
getFieldMapping()
Map from query param name to field name or Transformer that will act on input to get param value.
|
String |
getQuery()
Query to process.
|
boolean |
isExpectSingleResult()
If true it will attempt to return only 1 Object or null if no match to query
One should use the LIMIT keyword in query when setting this to true. |
boolean |
isParamAsSingleInput()
If true, will take whole input to transformer as a single parameter and pass it in query.
|
void |
setConnectionPool(com.orientechnologies.orient.core.db.OPartitionedDatabasePool connectionPool) |
void |
setExpectSingleResult(boolean expectSingleResult)
If true it will attempt to return only 1 Object or null if no match to query
One should use the LIMIT keyword in query when setting this to true. |
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 |
setParamAsSingleInput(boolean paramAsSingleInput)
If true, will take whole input to transformer as a single parameter and pass it in query.
|
void |
setQuery(String query)
Query to process.
|
Object |
transform(Object input)
ODBQueryTransformer
|
void |
updateContext(com.orientechnologies.orient.core.db.OPartitionedDatabasePool odbConnectionPool) |
protected transient com.orientechnologies.orient.core.db.OPartitionedDatabasePool connectionPool
ODatabasePool,
OPartitionedDatabasePoolprotected String query
protected boolean expectSingleResult
protected boolean paramAsSingleInput
protected Map<String,?> fieldMapping
protected transient com.orientechnologies.orient.core.db.ODatabase lastConnection
public ODBQueryTransformer()
public ODBQueryTransformer(String query, com.orientechnologies.orient.core.db.OPartitionedDatabasePool connectionPool)
query - : Query to be executedconnectionPool - : instance of Orientdb Connection pool ODatabasePool or OPartitionedDatabasePoolpublic ODBQueryTransformer(ODBQueryTransformer t)
protected abstract com.orientechnologies.orient.core.db.ODatabase<T> getConnection()
public void close()
public Object transform(Object input)
Structure of Prepared Queries :
Functions to query from database :
Input Types :
Object[] or Collection or Map or PageInfo transform in interface org.apache.commons.collections.Transformerinput - : parameter of type `Object[]` or `Collection` or `Map` or `PageInfo`public void updateContext(com.orientechnologies.orient.core.db.OPartitionedDatabasePool odbConnectionPool)
updateContext in interface UpdatableContext<com.orientechnologies.orient.core.db.OPartitionedDatabasePool>public String getQuery()
QueryTransformergetQuery in interface QueryTransformerpublic void setQuery(String query)
QueryTransformersetQuery in interface QueryTransformerpublic boolean isExpectSingleResult()
isExpectSingleResult in interface QueryTransformerpublic void setExpectSingleResult(boolean expectSingleResult)
setExpectSingleResult in interface QueryTransformerpublic boolean isParamAsSingleInput()
QueryTransformerisParamAsSingleInput in interface QueryTransformerpublic void setParamAsSingleInput(boolean paramAsSingleInput)
QueryTransformersetParamAsSingleInput in interface QueryTransformerpublic Map<String,?> getFieldMapping()
QueryTransformergetFieldMapping in interface QueryTransformerpublic void setFieldMapping(Map<String,?> fieldMapping)
QueryTransformersetFieldMapping in interface QueryTransformerpublic com.orientechnologies.orient.core.db.OPartitionedDatabasePool getConnectionPool()
public void setConnectionPool(com.orientechnologies.orient.core.db.OPartitionedDatabasePool connectionPool)
Copyright © 2018. All rights reserved.