Class OGraphCommandExecutorSQLFactory
java.lang.Object
com.orientechnologies.orient.graph.sql.OGraphCommandExecutorSQLFactory
- All Implemented Interfaces:
OCommandExecutorSQLFactory
Graph related command operator executor factory. It's auto-discovered.
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleancanReuseActiveGraph(ODatabaseDocument iGraphDatabase, ODatabaseDocument iThreadLocalDatabase) createCommand(String name) Create command for the given name.static OrientBaseGraphgetAnyGraph(OModifiableBoolean shouldBeShutDown) static ODatabaseDocumentstatic OrientGraphgetGraph(boolean autoStartTx, OModifiableBoolean shouldBeShutDown) Returns a Transactional OrientGraph implementation from the current database in thread local.static OrientGraphNoTxgetGraphNoTx(OModifiableBoolean shouldBeShutDown) static booleanstatic <T> Tstatic <T> TrunInTx(OGraphCommandExecutorSQLFactory.GraphCallBack<T> callBack) static <T> TrunInTx(OrientGraph graph, OGraphCommandExecutorSQLFactory.GraphCallBack<T> callBack) static <T> T
-
Constructor Details
-
OGraphCommandExecutorSQLFactory
public OGraphCommandExecutorSQLFactory()
-
-
Method Details
-
getGraph
Returns a Transactional OrientGraph implementation from the current database in thread local.- Parameters:
autoStartTx- Whether returned graph will start transaction before each operation till commit automatically or user should do it explicitly be callingOrientBaseGraph.getRawGraph()methodODatabaseDocumentTx.begin().- Returns:
- Transactional OrientGraph implementation from the current database in thread local.
-
getGraphNoTx
- Returns:
- a Non Transactional OrientGraph implementation from the current database in thread local.
-
getAnyGraph
- Returns:
- any graph if available, otherwise a Non Transactional OrientGraph implementation from the current database in thread local.
-
runInTx
public static <T> T runInTx(OrientGraph graph, OGraphCommandExecutorSQLFactory.GraphCallBack<T> callBack) -
runInTx
-
runWithAnyGraph
-
getDatabase
-
getCommandNames
- Specified by:
getCommandNamesin interfaceOCommandExecutorSQLFactory- Returns:
- Set of supported command names of this factory
-
createCommand
Create command for the given name. returned command may be a new instance each time or a constant.- Specified by:
createCommandin interfaceOCommandExecutorSQLFactory- Returns:
- OCommandExecutorSQLAbstract : created command
- Throws:
OCommandExecutionException- : when command creation fail
-
runInConfiguredTxMode
public static <T> T runInConfiguredTxMode(OGraphCommandExecutorSQLFactory.GraphCallBack<T> callBack) -
isTxRequiredForSQLGraphOperations
public static boolean isTxRequiredForSQLGraphOperations() -
getConsistencyMode
public static OGraphCommandExecutorSQLFactory.GRAPH_CONSISTENCY_MODE getConsistencyMode(OrientBaseGraph graph) -
canReuseActiveGraph
protected static boolean canReuseActiveGraph(ODatabaseDocument iGraphDatabase, ODatabaseDocument iThreadLocalDatabase)
-