Class OrientBaseGraph
java.lang.Object
com.tinkerpop.blueprints.impls.orient.OrientConfigurableGraph
com.tinkerpop.blueprints.impls.orient.OrientBaseGraph
- All Implemented Interfaces:
OStorageRecoverListener,com.tinkerpop.blueprints.Graph,OrientExtendedGraph,com.tinkerpop.blueprints.IndexableGraph,com.tinkerpop.blueprints.KeyIndexableGraph,com.tinkerpop.blueprints.MetaGraph<ODatabaseDocumentTx>
- Direct Known Subclasses:
OrientGraphNoTx,OrientTransactionalGraph
public abstract class OrientBaseGraph
extends OrientConfigurableGraph
implements OrientExtendedGraph, OStorageRecoverListener
A Blueprints implementation of the graph database OrientDB (http://orientdb.com)
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com) (http://orientdb.com)
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tinkerpop.blueprints.impls.orient.OrientConfigurableGraph
OrientConfigurableGraph.Settings, OrientConfigurableGraph.THREAD_MODE -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected ODatabaseDocumentInternalFields inherited from class com.tinkerpop.blueprints.impls.orient.OrientConfigurableGraph
AUTO_SCALE_EDGE_TYPE_DEFAULT, AUTO_START_TX_DEFAULT, EDGE_CONTAINER_EMBEDDED_2_TREE_THRESHOLD_DEFAULT, EDGE_CONTAINER_TREE_2_EMBEDDED_THRESHOLD_DEFAULT, KEEP_IN_MEMORY_REFERENCES_DEFAULT, REQUIRE_TRANSACTION_DEFAULT, SAVE_ORIGINAL_IDS_DEFAULT, settings, STANDARD_ELEMENT_CONSTRAINTS_DEFAULT, STANDARD_EXCEPTIONS, STANDARD_MAX_RETRIES, STANDARD_TX_REQUIRE_FOR_SQL_OPERATIONS, THREAD_MODE_DEFAULT, USE_CLASS_FOR_EDGE_LABEL_DEFAULT, USE_CLASS_FOR_VERTEX_LABEL_DEFAULT, USE_LIGHTWEIGHT_EDGES_DEFAULT, USE_LOG_DEFAULT, USE_VERTEX_FIELDS_FOR_EDGE_LABELS, WARN_ON_FORCE_CLOSING_TX_DEFAULT -
Constructor Summary
ConstructorsConstructorDescriptionOrientBaseGraph(ODatabaseDocumentInternal iDatabase, String iUserName, String iUserPassword, OrientConfigurableGraph.Settings iConfiguration) Constructs a new object using an existent database instance.OrientBaseGraph(OPartitionedDatabasePool pool, OrientConfigurableGraph.Settings iConfiguration) OrientBaseGraph(String url) OrientBaseGraph(String url, String username, String password) OrientBaseGraph(org.apache.commons.configuration.Configuration configuration) Builds a OrientGraph instance passing a configuration. -
Method Summary
Modifier and TypeMethodDescriptionaddEdge(Object id, com.tinkerpop.blueprints.Vertex outVertex, com.tinkerpop.blueprints.Vertex inVertex, String label) Creates an edge between a source Vertex and a destination Vertex setting label as Edge's label.addTemporaryVertex(String iClassName, Object... prop) (Blueprints Extension) Creates a temporary vertex setting the initial field values.Creates a new unconnected vertex with no fields in the Graph.(Blueprints Extension) Creates a new unconnected vertex in the Graph setting the initial field values.(Blueprints Extension) Creates a new unconnected vertex with no fields of specific class in a cluster in the Graph.attach(OrientElement iElement) Attaches a previously detached Graph Element to the current Graph.protected voidvoidbegin()begins current transaction (if the graph is transactional)static voidInternal use only.command(OCommandRequest iCommand) Executes commands against the graph.voidcommit()Commits the current active transaction.configure(OrientConfigurableGraph.Settings iSetting) (Blueprints Extension) Configure the Graph instance.protected ObjectconvertKey(OIndex idx, Object iValue) protected Object[]convertKeys(OIndex idx, Object[] iValue) longCounts the edges in graph.longcountEdges(String iClassName) Counts the edges in graph of a particular class.longCounts the vertices in graph.longcountVertices(String iClassName) Counts the vertices in graph of a particular class.createEdgeType(String iClassName) Creates a new Edge persistent class.createEdgeType(String iClassName, int clusters) Creates a new Edge persistent class.createEdgeType(String iClassName, OClass iSuperClass) Creates a new Edge persistent class specifying the super class.createEdgeType(String iClassName, OClass iSuperClass, int clusters) Creates a new Edge persistent class specifying the super class.createEdgeType(String iClassName, String iSuperClassName) Creates a new Edge persistent class specifying the super class.createEdgeType(String iClassName, String iSuperClassName, int clusters) Creates a new Edge persistent class specifying the super class.<T extends com.tinkerpop.blueprints.Element>
com.tinkerpop.blueprints.Index<T>createIndex(String indexName, Class<T> indexClass, com.tinkerpop.blueprints.Parameter... indexParameters) <T extends com.tinkerpop.blueprints.Element>
voidcreateKeyIndex(String key, Class<T> elementClass, com.tinkerpop.blueprints.Parameter... indexParameters) Creates an automatic indexing structure for indexing provided key for element class.createVertexType(String iClassName) Creates a new Vertex persistent class.createVertexType(String iClassName, int clusters) Creates a new Vertex persistent class.createVertexType(String iClassName, OClass iSuperClass) Creates a new Vertex persistent class specifying the super class.createVertexType(String iClassName, OClass iSuperClass, int clusters) Creates a new Vertex persistent class specifying the super class.createVertexType(String iClassName, String iSuperClassName) Creates a new Vertex persistent class specifying the super class.createVertexType(String iClassName, String iSuperClassName, int clusters) Creates a new Vertex persistent class specifying the super class.voiddeclareIntent(OIntent iIntent) Declare an intent.static StringdecodeClassName(String iClassName) (Internal)protected static voiddeleteEdgeIfAny(OIdentifiable iRecord, boolean forceReload) (Internal only)detach(OrientElement iElement) Detaches a Graph Element to be used offline.voiddrop()(Blueprints Extension) Drops the databasevoiddropEdgeType(String iTypeName) Drops an edge class.voidDrops an index by name.<T extends com.tinkerpop.blueprints.Element>
voiddropKeyIndex(String key, Class<T> elementClass) Drops the index against a field name.voiddropVertexType(String iTypeName) Drop a vertex class.static StringencodeClassName(String iClassName) (Internal)static voidencodeClassNames(String... iLabels) (Internal)<RET> RETexecuteOutsideTx(OCallable<RET, OrientBaseGraph> iCallable, String... iOperationStrings) static OrientBaseGraphprotected <T> StringgetClassName(Class<T> elementClass) protected ODatabaseDocumentInternalprotected static ODocumentgetDocument(OIdentifiable id, boolean forceReload) Returns a edge by an ID.Returns the E persistent class as OrientEdgeType instance.static voidgetEdgeClassNames(OrientBaseGraph graph, String... iLabels) (Internal) Returns the case sensitive edge class names.protected OrientEdgeprotected OrientEdgegetEdgeInstance(OIdentifiable from, OIdentifiable to, String label) protected OrientEdgegetEdgeInstance(String className, Object... fields) Iterable<com.tinkerpop.blueprints.Edge>getEdges()Returns all the edges in Graph.Iterable<com.tinkerpop.blueprints.Edge>getEdges(boolean iPolymorphic) Get all the Edges in Graph specifying if consider or not sub-classes of E.Iterable<com.tinkerpop.blueprints.Edge>Get all the Edges in Graph filtering by field name and value.Iterable<com.tinkerpop.blueprints.Edge>getEdgesOfClass(String iClassName) Get all the Edges in Graph of a specific edge class and all sub-classes.Iterable<com.tinkerpop.blueprints.Edge>getEdgesOfClass(String iClassName, boolean iPolymorphic) Get all the Edges in Graph of a specific edges class and all sub-classes only if iPolymorphic is true.getEdgeType(String iTypeName) Returns the persistent class for type iTypeName as OrientEdgeType instance.getElement(Object id) Returns a graph element, vertex or edge, starting from an ID.<T extends com.tinkerpop.blueprints.Element>
com.tinkerpop.blueprints.Index<T>Returns an index by name and classgetIndexedKeys(Class<T> elementClass) Returns the indexed properties.getIndexedKeys(Class<T> elementClass, boolean includeClassNames) Returns the indexed properties.Iterable<com.tinkerpop.blueprints.Index<? extends com.tinkerpop.blueprints.Element>>Returns all the indices.protected ObjectgetProperty(String iName) Returns the underlying Database instance as ODatabaseDocumentTx instance.Returns a vertex by an ID.Returns the V persistent class as OrientVertexType instance.com.tinkerpop.blueprints.VertexgetVertexByKey(String iKey, Object iValue) Deprecated.protected OrientVertexprotected OrientVertexgetVertexInstance(String className, Object... fields) getVertexType(String iTypeName) Returns the persistent class for type iTypeName as OrientVertexType instance.Iterable<com.tinkerpop.blueprints.Vertex>Get all the Vertices in Graph.Iterable<com.tinkerpop.blueprints.Vertex>getVertices(boolean iPolymorphic) Get all the Vertices in Graph specifying if consider or not sub-classes of V.Iterable<com.tinkerpop.blueprints.Vertex>getVertices(String iKey, Object iValue) Get all the Vertices in Graph filtering by field name and value.Iterable<com.tinkerpop.blueprints.Vertex>getVertices(String label, String[] iKey, Object[] iValue) Get all the Vertices in Graph filtering by field name and value.Iterable<com.tinkerpop.blueprints.Vertex>getVerticesOfClass(String iClassName) Get all the Vertices in Graph of a specific vertex class and all sub-classes.Iterable<com.tinkerpop.blueprints.Vertex>getVerticesOfClass(String iClassName, boolean iPolymorphic) Get all the Vertices in Graph of a specific vertex class and all sub-classes only if iPolymorphic is true.booleanisClosed()Checks if the Graph has been closed.voidvoidcom.tinkerpop.blueprints.GraphQueryquery()Returns a GraphQuery object to execute queries against the Graph.voidremoveEdge(com.tinkerpop.blueprints.Edge edge) Removes an edge from the Graph.protected static voidremoveEdges(OrientBaseGraph graph, ODocument iVertex, String iFieldName, OIdentifiable iVertexToRemove, boolean iAlsoInverse, boolean useVertexFieldsForEdgeLabels, boolean autoScaleEdgeType, boolean forceReload) (Internal only)voidremoveVertex(com.tinkerpop.blueprints.Vertex vertex) Removes a vertex from the Graph.reuse(ODatabaseDocumentInternal iDatabase) Reuses the underlying database avoiding to create and open it every time.voidrollback()Rollbacks the current active transaction.protected voidsetConflictStrategy(ORecordConflictStrategy iResolver) setConflictStrategy(String iStrategyName) protected voidprotected ObjectsetProperty(String iName, Object iValue) setUseLightweightEdges(boolean useDynamicEdges) Changes the setting about usage of lightweight edges.voidshutdown()Closes the Graph.voidshutdown(boolean closeDb) Closes the Graph.voidshutdown(boolean closeDb, boolean commitTx) Closes the Graph.toString()Returns the Graph URL.traverse()Returns a OTraverse object to start traversing the graph.Methods inherited from class com.tinkerpop.blueprints.impls.orient.OrientConfigurableGraph
getConnectionStrategy, getEdgeContainerEmbedded2TreeThreshold, getEdgeContainerTree2EmbeddedThreshold, getMaxRetries, getThreadMode, init, isAutoScaleEdgeType, isAutoStartTx, isKeepInMemoryReferences, isRequireTransaction, isSaveOriginalIds, isStandardElementConstraints, isStandardExceptions, isTxRequiredForSQLGraphOperations, isUseClassForEdgeLabel, isUseClassForVertexLabel, isUseLightweightEdges, isUseVertexFieldsForEdgeLabels, isWarnOnForceClosingTx, setAutoScaleEdgeType, setAutoStartTx, setConnectionStrategy, setEdgeContainerEmbedded2TreeThreshold, setEdgeContainerTree2EmbeddedThreshold, setKeepInMemoryReferences, setMaxRetries, setRequireTransaction, setSaveOriginalIds, setStandardElementConstraints, setStandardExceptions, setThreadMode, setTxRequiredForSQLGraphOperations, setUseClassForEdgeLabel, setUseClassForVertexLabel, setUseLog, setUseVertexFieldsForEdgeLabels, setWarnOnForceClosingTxMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.tinkerpop.blueprints.Graph
getFeatures
-
Field Details
-
CONNECTION_OUT
- See Also:
-
CONNECTION_IN
- See Also:
-
CLASS_PREFIX
- See Also:
-
CLUSTER_PREFIX
- See Also:
-
ADMIN
- See Also:
-
database
-
-
Constructor Details
-
OrientBaseGraph
public OrientBaseGraph(ODatabaseDocumentInternal iDatabase, String iUserName, String iUserPassword, OrientConfigurableGraph.Settings iConfiguration) Constructs a new object using an existent database instance.- Parameters:
iDatabase- Underlying database object to attach
-
OrientBaseGraph
-
OrientBaseGraph
public OrientBaseGraph(OPartitionedDatabasePool pool, OrientConfigurableGraph.Settings iConfiguration) -
OrientBaseGraph
-
OrientBaseGraph
-
OrientBaseGraph
public OrientBaseGraph(org.apache.commons.configuration.Configuration configuration) Builds a OrientGraph instance passing a configuration. Supported configuration settings are:Name Description Default value blueprints.orientdb.url Database URL - blueprints.orientdb.username User name admin blueprints.orientdb.password User password admin blueprints.orientdb.saveOriginalIds Saves the original element IDs by using the property origId. This could be useful on import of graph to preserve original ids false blueprints.orientdb.keepInMemoryReferences Avoid to keep records in memory but only RIDs false blueprints.orientdb.useCustomClassesForEdges Use Edge's label as OrientDB class. If doesn't exist create it under the hood true blueprints.orientdb.useCustomClassesForVertex Use Vertex's label as OrientDB class. If doesn't exist create it under the hood true blueprints.orientdb.useVertexFieldsForEdgeLabels Store the edge relationships in vertex by using the Edge's class. This allow to use multiple fields and make faster traversal by edge's label (class) true blueprints.orientdb.lightweightEdges Uses lightweight edges. This avoid to create a physical document per edge. Documents are created only when they have properties true blueprints.orientdb.autoScaleEdgeType Set auto scale of edge type. True means one edge is managed as LINK, 2 or more are managed with a LINKBAG false blueprints.orientdb.edgeContainerEmbedded2TreeThreshold Changes the minimum number of edges for edge containers to transform the underlying structure from embedded to tree. Use -1 to disable transformation -1 blueprints.orientdb.edgeContainerTree2EmbeddedThreshold Changes the minimum number of edges for edge containers to transform the underlying structure from tree to embedded. Use -1 to disable transformation -1 - Parameters:
configuration- of graph
-
-
Method Details
-
getActiveGraph
-
clearInitStack
public static void clearInitStack()Internal use only. -
onStorageRecover
public void onStorageRecover()- Specified by:
onStorageRecoverin interfaceOStorageRecoverListener
-
encodeClassNames
(Internal) -
getEdgeClassNames
(Internal) Returns the case sensitive edge class names. -
encodeClassName
(Internal) -
decodeClassName
(Internal) -
makeActive
public void makeActive() -
configure
(Blueprints Extension) Configure the Graph instance.- Parameters:
iSetting- Settings object containing all the settings
-
drop
public void drop()(Blueprints Extension) Drops the database- Specified by:
dropin interfaceOrientExtendedGraph
-
createIndex
public <T extends com.tinkerpop.blueprints.Element> com.tinkerpop.blueprints.Index<T> createIndex(String indexName, Class<T> indexClass, com.tinkerpop.blueprints.Parameter... indexParameters) - Specified by:
createIndexin interfacecom.tinkerpop.blueprints.IndexableGraph
-
getIndex
public <T extends com.tinkerpop.blueprints.Element> com.tinkerpop.blueprints.Index<T> getIndex(String indexName, Class<T> indexClass) Returns an index by name and class- Specified by:
getIndexin interfacecom.tinkerpop.blueprints.IndexableGraph- Parameters:
indexName- Index nameindexClass- Class as one or subclass of Vertex.class and Edge.class- Returns:
- Index instance
-
getIndices
public Iterable<com.tinkerpop.blueprints.Index<? extends com.tinkerpop.blueprints.Element>> getIndices()Returns all the indices.- Specified by:
getIndicesin interfacecom.tinkerpop.blueprints.IndexableGraph- Returns:
- Iterable of Index instances
-
dropIndex
Drops an index by name.- Specified by:
dropIndexin interfacecom.tinkerpop.blueprints.IndexableGraph- Parameters:
indexName- Index name
-
addVertex
Creates a new unconnected vertex with no fields in the Graph.- Specified by:
addVertexin interfacecom.tinkerpop.blueprints.Graph- Parameters:
id- Optional, can contains the Vertex's class name by prefixing with "class:"- Returns:
- The new OrientVertex created
-
getConflictStrategy
- Specified by:
getConflictStrategyin interfaceOrientExtendedGraph
-
setConflictStrategy
- Specified by:
setConflictStrategyin interfaceOrientExtendedGraph
-
setConflictStrategy
- Specified by:
setConflictStrategyin interfaceOrientExtendedGraph
-
addVertex
(Blueprints Extension) Creates a new unconnected vertex in the Graph setting the initial field values.- Specified by:
addVertexin interfaceOrientExtendedGraph- Parameters:
id- Optional, can contains the Vertex's class name by prefixing with "class:"prop- Fields must be a odd pairs of key/value or a single object as Map containing entries as key/value pairs- Returns:
- The new OrientVertex created
-
addVertex
(Blueprints Extension) Creates a new unconnected vertex with no fields of specific class in a cluster in the Graph.- Parameters:
iClassName- Vertex class nameiClusterName- Vertex cluster name- Returns:
- New vertex created
-
addTemporaryVertex
(Blueprints Extension) Creates a temporary vertex setting the initial field values. The vertex is not saved and the transaction is not started.- Specified by:
addTemporaryVertexin interfaceOrientExtendedGraph- Parameters:
iClassName- Vertex's class nameprop- Fields must be a odd pairs of key/value or a single object as Map containing entries as key/value pairs- Returns:
- added vertex
-
addEdge
public OrientEdge addEdge(Object id, com.tinkerpop.blueprints.Vertex outVertex, com.tinkerpop.blueprints.Vertex inVertex, String label) Creates an edge between a source Vertex and a destination Vertex setting label as Edge's label.- Specified by:
addEdgein interfacecom.tinkerpop.blueprints.Graph- Parameters:
id- Optional, can contains the Edge's class name by prefixing with "class:"outVertex- Source vertexinVertex- Destination vertexlabel- Edge's label
-
getVertex
Returns a vertex by an ID.- Specified by:
getVertexin interfacecom.tinkerpop.blueprints.Graph- Parameters:
id- Can by a String, ODocument or an OIdentifiable object.
-
declareIntent
Description copied from interface:OrientExtendedGraphDeclare an intent.- Specified by:
declareIntentin interfaceOrientExtendedGraph- Specified by:
declareIntentin classOrientConfigurableGraph
-
getActiveIntent
-
removeVertex
public void removeVertex(com.tinkerpop.blueprints.Vertex vertex) Removes a vertex from the Graph. All the edges connected to the Vertex are automatically removed.- Specified by:
removeVertexin interfacecom.tinkerpop.blueprints.Graph- Parameters:
vertex- Vertex to remove
-
getVertices
Get all the Vertices in Graph.- Specified by:
getVerticesin interfacecom.tinkerpop.blueprints.Graph- Returns:
- Vertices as Iterable
-
getVertices
Get all the Vertices in Graph specifying if consider or not sub-classes of V.- Parameters:
iPolymorphic- If true then get all the vertices of any sub-class- Returns:
- Vertices as Iterable
-
getVerticesOfClass
Get all the Vertices in Graph of a specific vertex class and all sub-classes.- Parameters:
iClassName- Vertex class name to filter- Returns:
- Vertices as Iterable
-
getVerticesOfClass
public Iterable<com.tinkerpop.blueprints.Vertex> getVerticesOfClass(String iClassName, boolean iPolymorphic) Get all the Vertices in Graph of a specific vertex class and all sub-classes only if iPolymorphic is true.- Parameters:
iClassName- Vertex class name to filteriPolymorphic- If true consider also Vertex iClassName sub-classes- Returns:
- Vertices as Iterable
-
getVertices
Get all the Vertices in Graph filtering by field name and value. Example:Iterableresultset = getVertices("name", "Jay"); - Specified by:
getVerticesin interfacecom.tinkerpop.blueprints.Graph- Parameters:
iKey- Field nameiValue- Field value- Returns:
- Vertices as Iterable
-
getVertexByKey
Deprecated.Lookup for a vertex by id using an index.
This API relies on Unique index (SBTREE/HASH) but is deprecated.
Example:Vertex v = getVertexByKey("V.name", "name", "Jay");- Parameters:
iKey- Name of the indexed propertyiValue- Field value- Returns:
- Vertex instance if found, otherwise null
- See Also:
-
getVertices
public Iterable<com.tinkerpop.blueprints.Vertex> getVertices(String label, String[] iKey, Object[] iValue) Get all the Vertices in Graph filtering by field name and value. Example:Iterableresultset = getVertices("Person",new String[] {"name","surname"},new Object[] { "Sherlock" ,"Holmes"}); - Parameters:
iKey- Fields nameiValue- Fields value- Returns:
- Vertices as Iterable
-
getEdges
Returns all the edges in Graph.- Specified by:
getEdgesin interfacecom.tinkerpop.blueprints.Graph- Returns:
- Edges as Iterable
-
getEdges
Get all the Edges in Graph specifying if consider or not sub-classes of E.- Parameters:
iPolymorphic- If true then get all the edge of any sub-class- Returns:
- Edges as Iterable
-
getEdgesOfClass
Get all the Edges in Graph of a specific edge class and all sub-classes.- Parameters:
iClassName- Edge class name to filter- Returns:
- Edges as Iterable
-
getEdgesOfClass
public Iterable<com.tinkerpop.blueprints.Edge> getEdgesOfClass(String iClassName, boolean iPolymorphic) Get all the Edges in Graph of a specific edges class and all sub-classes only if iPolymorphic is true.- Parameters:
iClassName- Edge class name to filteriPolymorphic- If true consider also iClassName Edge sub-classes- Returns:
- Edges as Iterable
-
getEdges
Get all the Edges in Graph filtering by field name and value. Example:Iterableresultset = getEdges("name", "Jay"); - Specified by:
getEdgesin interfacecom.tinkerpop.blueprints.Graph- Parameters:
iKey- Field namevalue- Field value- Returns:
- Edges as Iterable
-
getEdge
Returns a edge by an ID.- Specified by:
getEdgein interfacecom.tinkerpop.blueprints.Graph- Parameters:
id- Can by a String, ODocument or an OIdentifiable object.
-
removeEdge
public void removeEdge(com.tinkerpop.blueprints.Edge edge) Removes an edge from the Graph.- Specified by:
removeEdgein interfacecom.tinkerpop.blueprints.Graph- Parameters:
edge- Edge to remove
-
reuse
Reuses the underlying database avoiding to create and open it every time.- Parameters:
iDatabase- Underlying database object
-
isClosed
public boolean isClosed()Checks if the Graph has been closed.- Returns:
- True if it is closed, otherwise false
-
shutdown
public void shutdown()Closes the Graph. After closing the Graph cannot be used.- Specified by:
shutdownin interfacecom.tinkerpop.blueprints.Graph
-
shutdown
public void shutdown(boolean closeDb) Closes the Graph. After closing the Graph cannot be used. -
shutdown
public void shutdown(boolean closeDb, boolean commitTx) Closes the Graph. After closing the Graph cannot be used. -
toString
Returns the Graph URL. -
getRawGraph
Returns the underlying Database instance as ODatabaseDocumentTx instance.- Specified by:
getRawGraphin interfacecom.tinkerpop.blueprints.MetaGraph<ODatabaseDocumentTx>
-
begin
public void begin()begins current transaction (if the graph is transactional) -
commit
public void commit()Commits the current active transaction. -
rollback
public void rollback()Rollbacks the current active transaction. All the pending changes are rollbacked. -
getVertexBaseType
Returns the V persistent class as OrientVertexType instance.- Specified by:
getVertexBaseTypein interfaceOrientExtendedGraph
-
getVertexType
Returns the persistent class for type iTypeName as OrientVertexType instance.- Specified by:
getVertexTypein interfaceOrientExtendedGraph- Parameters:
iTypeName- Vertex class name
-
createVertexType
Creates a new Vertex persistent class.- Specified by:
createVertexTypein interfaceOrientExtendedGraph- Parameters:
iClassName- Vertex class name- Returns:
- OrientVertexType instance representing the persistent class
-
createVertexType
Creates a new Vertex persistent class.- Specified by:
createVertexTypein interfaceOrientExtendedGraph- Parameters:
iClassName- Vertex class nameclusters- The number of clusters to create for the new class. By default the MINIMUMCLUSTERS database setting is used. In v2.2 and later, the number of clusters are proportioned to the amount of cores found on the machine- Returns:
- OrientVertexType instance representing the persistent class
-
createVertexType
Creates a new Vertex persistent class specifying the super class.- Specified by:
createVertexTypein interfaceOrientExtendedGraph- Parameters:
iClassName- Vertex class nameiSuperClassName- Vertex class name to extend- Returns:
- OrientVertexType instance representing the persistent class
-
createVertexType
Creates a new Vertex persistent class specifying the super class.- Specified by:
createVertexTypein interfaceOrientExtendedGraph- Parameters:
iClassName- Vertex class nameiSuperClassName- Vertex class name to extendclusters- The number of clusters to create for the new class. By default the MINIMUMCLUSTERS database setting is used. In v2.2 and later, the number of clusters are proportioned to the amount of cores found on the machine- Returns:
- OrientVertexType instance representing the persistent class
-
createVertexType
Creates a new Vertex persistent class specifying the super class.- Specified by:
createVertexTypein interfaceOrientExtendedGraph- Parameters:
iClassName- Vertex class nameiSuperClass- OClass Vertex to extend- Returns:
- OrientVertexType instance representing the persistent class
-
createVertexType
Creates a new Vertex persistent class specifying the super class.- Specified by:
createVertexTypein interfaceOrientExtendedGraph- Parameters:
iClassName- Vertex class nameiSuperClass- OClass Vertex to extendclusters- The number of clusters to create for the new class. By default the MINIMUMCLUSTERS database setting is used. In v2.2 and later, the number of clusters are proportioned to the amount of cores found on the machine- Returns:
- OrientVertexType instance representing the persistent class
-
dropVertexType
Drop a vertex class.- Specified by:
dropVertexTypein interfaceOrientExtendedGraph- Parameters:
iTypeName- Vertex class name
-
getEdgeBaseType
Returns the E persistent class as OrientEdgeType instance.- Specified by:
getEdgeBaseTypein interfaceOrientExtendedGraph
-
getEdgeType
Returns the persistent class for type iTypeName as OrientEdgeType instance.- Specified by:
getEdgeTypein interfaceOrientExtendedGraph- Parameters:
iTypeName- Edge class name
-
createEdgeType
Creates a new Edge persistent class.- Specified by:
createEdgeTypein interfaceOrientExtendedGraph- Parameters:
iClassName- Edge class name- Returns:
- OrientEdgeType instance representing the persistent class
-
createEdgeType
Creates a new Edge persistent class.- Parameters:
iClassName- Edge class nameclusters- The number of clusters to create for the new class. By default the MINIMUMCLUSTERS database setting is used. In v2.2 and later, the number of clusters are proportioned to the amount of cores found on the machine- Returns:
- OrientEdgeType instance representing the persistent class
-
createEdgeType
Creates a new Edge persistent class specifying the super class.- Specified by:
createEdgeTypein interfaceOrientExtendedGraph- Parameters:
iClassName- Edge class nameiSuperClassName- Edge class name to extend- Returns:
- OrientEdgeType instance representing the persistent class
-
createEdgeType
Creates a new Edge persistent class specifying the super class.- Parameters:
iClassName- Edge class nameiSuperClassName- Edge class name to extendclusters- The number of clusters to create for the new class. By default the MINIMUMCLUSTERS database setting is used. In v2.2 and later, the number of clusters are proportioned to the amount of cores found on the machine- Returns:
- OrientEdgeType instance representing the persistent class
-
createEdgeType
Creates a new Edge persistent class specifying the super class.- Specified by:
createEdgeTypein interfaceOrientExtendedGraph- Parameters:
iClassName- Edge class nameiSuperClass- OClass Edge to extendclusters- The number of clusters to create for the new class. By default the MINIMUMCLUSTERS database setting is used. In v2.2 and later, the number of clusters are proportioned to the amount of cores found on the machine- Returns:
- OrientEdgeType instance representing the persistent class
-
createEdgeType
Creates a new Edge persistent class specifying the super class.- Specified by:
createEdgeTypein interfaceOrientExtendedGraph- Parameters:
iClassName- Edge class nameiSuperClass- OClass Edge to extend- Returns:
- OrientEdgeType instance representing the persistent class
-
dropEdgeType
Drops an edge class.- Specified by:
dropEdgeTypein interfaceOrientExtendedGraph- Parameters:
iTypeName- Edge class name
-
detach
Detaches a Graph Element to be used offline. All the changes will be committed on further @attach call.- Specified by:
detachin interfaceOrientExtendedGraph- Parameters:
iElement- Graph element to detach- Returns:
- The detached element
- See Also:
-
attach
Attaches a previously detached Graph Element to the current Graph. All the pending changes will be committed.- Specified by:
attachin interfaceOrientExtendedGraph- Parameters:
iElement- Graph element to attach- Returns:
- The attached element
- See Also:
-
getElement
Returns a graph element, vertex or edge, starting from an ID.- Parameters:
id- Can by a String, ODocument or an OIdentifiable object.- Returns:
- OrientElement subclass such as OrientVertex or OrientEdge
-
dropKeyIndex
public <T extends com.tinkerpop.blueprints.Element> void dropKeyIndex(String key, Class<T> elementClass) Drops the index against a field name.- Specified by:
dropKeyIndexin interfacecom.tinkerpop.blueprints.KeyIndexableGraph- Parameters:
key- Field nameelementClass- Element class as instances of Vertex and Edge
-
createKeyIndex
public <T extends com.tinkerpop.blueprints.Element> void createKeyIndex(String key, Class<T> elementClass, com.tinkerpop.blueprints.Parameter... indexParameters) Creates an automatic indexing structure for indexing provided key for element class.- Specified by:
createKeyIndexin interfacecom.tinkerpop.blueprints.KeyIndexableGraph- Type Parameters:
T- the element class specification- Parameters:
key- the key to create the index forelementClass- the element class that the index is forindexParameters- a collection of parameters for the underlying index implementation:- "type" is the index type between the supported types (UNIQUE, NOTUNIQUE, FULLTEXT). The default type is NOT_UNIQUE
- "class" is the class to index when it's a custom type derived by Vertex (V) or Edge (E)
- "keytype" to use a key type different by OType.STRING,
-
getIndexedKeys
public <T extends com.tinkerpop.blueprints.Element> Set<String> getIndexedKeys(Class<T> elementClass) Returns the indexed properties.- Specified by:
getIndexedKeysin interfacecom.tinkerpop.blueprints.KeyIndexableGraph- Parameters:
elementClass- the element class that the index is for- Returns:
- Set of String containing the indexed properties
-
getIndexedKeys
public <T extends com.tinkerpop.blueprints.Element> Set<String> getIndexedKeys(Class<T> elementClass, boolean includeClassNames) Returns the indexed properties.- Parameters:
elementClass- the element class that the index is forincludeClassNames- If true includes also the class name as prefix of fields- Returns:
- Set of String containing the indexed properties
-
query
public com.tinkerpop.blueprints.GraphQuery query()Returns a GraphQuery object to execute queries against the Graph.- Specified by:
queryin interfacecom.tinkerpop.blueprints.Graph- Specified by:
queryin interfaceOrientExtendedGraph- Returns:
- new GraphQuery instance
-
traverse
Returns a OTraverse object to start traversing the graph.- Specified by:
traversein interfaceOrientExtendedGraph
-
command
Executes commands against the graph. Commands are executed outside transaction.- Specified by:
commandin interfaceOrientExtendedGraph- Parameters:
iCommand- Command request between SQL, GREMLIN and SCRIPT commands
-
countVertices
public long countVertices()Counts the vertices in graph.- Specified by:
countVerticesin interfaceOrientExtendedGraph- Returns:
- Long as number of total vertices
-
countVertices
Counts the vertices in graph of a particular class.- Specified by:
countVerticesin interfaceOrientExtendedGraph- Returns:
- Long as number of total vertices
-
countEdges
public long countEdges()Counts the edges in graph. Edge counting works only if useLightweightEdges is false.- Specified by:
countEdgesin interfaceOrientExtendedGraph- Returns:
- Long as number of total edges
-
countEdges
Counts the edges in graph of a particular class. Edge counting works only if useLightweightEdges is false.- Specified by:
countEdgesin interfaceOrientExtendedGraph- Returns:
- Long as number of total edges
-
executeOutsideTx
public <RET> RET executeOutsideTx(OCallable<RET, OrientBaseGraph> iCallable, String... iOperationStrings) throws RuntimeException- Throws:
RuntimeException
-
autoStartTransaction
protected void autoStartTransaction() -
saveIndexConfiguration
protected void saveIndexConfiguration() -
getClassName
-
convertKey
-
convertKeys
-
setCurrentGraphInThreadLocal
protected void setCurrentGraphInThreadLocal() -
getDatabase
-
removeEdges
protected static void removeEdges(OrientBaseGraph graph, ODocument iVertex, String iFieldName, OIdentifiable iVertexToRemove, boolean iAlsoInverse, boolean useVertexFieldsForEdgeLabels, boolean autoScaleEdgeType, boolean forceReload) (Internal only) -
getDocument
-
deleteEdgeIfAny
(Internal only) -
getVertexInstance
-
getVertexInstance
-
getEdgeInstance
-
getEdgeInstance
-
getEdgeInstance
-
setUseLightweightEdges
Description copied from class:OrientConfigurableGraphChanges the setting about usage of lightweight edges.- Overrides:
setUseLightweightEdgesin classOrientConfigurableGraph
-
setProperty
- Specified by:
setPropertyin classOrientConfigurableGraph
-
getProperty
- Specified by:
getPropertyin classOrientConfigurableGraph
-
getProperties
- Specified by:
getPropertiesin classOrientConfigurableGraph
-