public class ODBExecuteTransformer extends Object implements UpdatableContext<com.orientechnologies.orient.core.db.OPartitionedDatabasePool>, org.apache.commons.collections.Transformer, Serializable
Transformer
:
Orientdb Execute transformer :
Fire any OrientDb DML query to manipulate records and classes of ODB database.
Input types to transformer : Transformer accepts inputs of type Object[] or Collection or through class member fieldMapping.
Collection
will be converted to an Object[].
Object
[] or a List. Structure of Prepared Queries :
OCommandSQL
commandQuer = new OCommandSQL
("UPDATE King SET kingdom = 'Winterfell' WHERE name = ?");
OCommandSQL
commandQuer = new OCommandSQL
("UPDATE King SET kingdom = 'Winterfell' WHERE name = :kingName");
Functions to query from database :
Transformer
,
UpdatableContext
,
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
fieldMapping
Map from query param name to field name or Transformer that will act on input to get param value.
|
protected String |
query
Orientdb Query to process
|
Constructor and Description |
---|
ODBExecuteTransformer() |
ODBExecuteTransformer(ODBExecuteTransformer t) |
ODBExecuteTransformer(String query,
com.orientechnologies.orient.core.db.OPartitionedDatabasePool connectionPool) |
Modifier and Type | Method and Description |
---|---|
com.orientechnologies.orient.core.db.OPartitionedDatabasePool |
getConnectionPool() |
Map<String,Object> |
getFieldMapping() |
String |
getQuery() |
void |
setConnectionPool(com.orientechnologies.orient.core.db.OPartitionedDatabasePool connectionPool) |
void |
setFieldMapping(Map<String,Object> fieldMapping) |
void |
setQuery(String query) |
Object |
transform(Object input)
ODBExecuteTransformer
|
void |
updateContext(com.orientechnologies.orient.core.db.OPartitionedDatabasePool connectionPool) |
protected Map<String,Object> fieldMapping
protected String query
public ODBExecuteTransformer()
public ODBExecuteTransformer(ODBExecuteTransformer t)
public ODBExecuteTransformer(String query, com.orientechnologies.orient.core.db.OPartitionedDatabasePool connectionPool)
query
- : Query to be executedconnectionPool
- : instance of Orientdb Connection pool ODatabasePool
or OPartitionedDatabasePool
public Object transform(Object input)
Structure of Prepared Queries :
OCommandSQL
commandQuer = new OCommandSQL
("UPDATE King SET kingdom = 'Winterfell' WHERE name = ?");
OCommandSQL
commandQuer = new OCommandSQL
("UPDATE King SET kingdom = 'Winterfell' WHERE name = :kingName");
Functions to query from database :
Response returned from running different commands
Input Types :
Object
[] or Collection
or Map
or PageInfo
. transform
in interface org.apache.commons.collections.Transformer
input
- : parameter of type `Object[]` or `Collection` or some String/Integer treated in a whole as parameter.ODocument
: Extract it from OResultSet
to get valuable result. Details : here
OSQLSynchQuery
or OSQLAsynchQuery
as parameter. No such non deprecated solution was available when last checked. Refer to neurosys doc herepublic void updateContext(com.orientechnologies.orient.core.db.OPartitionedDatabasePool connectionPool)
updateContext
in interface UpdatableContext<com.orientechnologies.orient.core.db.OPartitionedDatabasePool>
UpdatableContext
public String getQuery()
public void setQuery(String query)
public com.orientechnologies.orient.core.db.OPartitionedDatabasePool getConnectionPool()
public void setConnectionPool(com.orientechnologies.orient.core.db.OPartitionedDatabasePool connectionPool)
Copyright © 2018. All rights reserved.