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)
  • Field Details

  • 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

      public OrientBaseGraph(OPartitionedDatabasePool pool)
    • OrientBaseGraph

      public OrientBaseGraph(OPartitionedDatabasePool pool, OrientConfigurableGraph.Settings iConfiguration)
    • OrientBaseGraph

      public OrientBaseGraph(String url)
    • OrientBaseGraph

      public OrientBaseGraph(String url, String username, String password)
    • 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

      public static OrientBaseGraph getActiveGraph()
    • clearInitStack

      public static void clearInitStack()
      Internal use only.
    • onStorageRecover

      public void onStorageRecover()
      Specified by:
      onStorageRecover in interface OStorageRecoverListener
    • encodeClassNames

      public static void encodeClassNames(String... iLabels)
      (Internal)
    • getEdgeClassNames

      public static void getEdgeClassNames(OrientBaseGraph graph, String... iLabels)
      (Internal) Returns the case sensitive edge class names.
    • encodeClassName

      public static String encodeClassName(String iClassName)
      (Internal)
    • decodeClassName

      public static String decodeClassName(String iClassName)
      (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:
      drop in interface OrientExtendedGraph
    • 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:
      createIndex in interface com.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:
      getIndex in interface com.tinkerpop.blueprints.IndexableGraph
      Parameters:
      indexName - Index name
      indexClass - 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:
      getIndices in interface com.tinkerpop.blueprints.IndexableGraph
      Returns:
      Iterable of Index instances
    • dropIndex

      public void dropIndex(String indexName)
      Drops an index by name.
      Specified by:
      dropIndex in interface com.tinkerpop.blueprints.IndexableGraph
      Parameters:
      indexName - Index name
    • addVertex

      public OrientVertex addVertex(Object id)
      Creates a new unconnected vertex with no fields in the Graph.
      Specified by:
      addVertex in interface com.tinkerpop.blueprints.Graph
      Parameters:
      id - Optional, can contains the Vertex's class name by prefixing with "class:"
      Returns:
      The new OrientVertex created
    • getConflictStrategy

      public ORecordConflictStrategy getConflictStrategy()
      Specified by:
      getConflictStrategy in interface OrientExtendedGraph
    • setConflictStrategy

      public OrientBaseGraph setConflictStrategy(String iStrategyName)
      Specified by:
      setConflictStrategy in interface OrientExtendedGraph
    • setConflictStrategy

      public OrientBaseGraph setConflictStrategy(ORecordConflictStrategy iResolver)
      Specified by:
      setConflictStrategy in interface OrientExtendedGraph
    • addVertex

      public OrientVertex addVertex(Object id, Object... prop)
      (Blueprints Extension) Creates a new unconnected vertex in the Graph setting the initial field values.
      Specified by:
      addVertex in interface OrientExtendedGraph
      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

      public OrientVertex addVertex(String iClassName, String iClusterName)
      (Blueprints Extension) Creates a new unconnected vertex with no fields of specific class in a cluster in the Graph.
      Parameters:
      iClassName - Vertex class name
      iClusterName - Vertex cluster name
      Returns:
      New vertex created
    • addTemporaryVertex

      public OrientVertex addTemporaryVertex(String iClassName, Object... prop)
      (Blueprints Extension) Creates a temporary vertex setting the initial field values. The vertex is not saved and the transaction is not started.
      Specified by:
      addTemporaryVertex in interface OrientExtendedGraph
      Parameters:
      iClassName - Vertex's class name
      prop - 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:
      addEdge in interface com.tinkerpop.blueprints.Graph
      Parameters:
      id - Optional, can contains the Edge's class name by prefixing with "class:"
      outVertex - Source vertex
      inVertex - Destination vertex
      label - Edge's label
    • getVertex

      public OrientVertex getVertex(Object id)
      Returns a vertex by an ID.
      Specified by:
      getVertex in interface com.tinkerpop.blueprints.Graph
      Parameters:
      id - Can by a String, ODocument or an OIdentifiable object.
    • declareIntent

      public void declareIntent(OIntent iIntent)
      Description copied from interface: OrientExtendedGraph
      Declare an intent.
      Specified by:
      declareIntent in interface OrientExtendedGraph
      Specified by:
      declareIntent in class OrientConfigurableGraph
    • getActiveIntent

      public OIntent 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:
      removeVertex in interface com.tinkerpop.blueprints.Graph
      Parameters:
      vertex - Vertex to remove
    • getVertices

      public Iterable<com.tinkerpop.blueprints.Vertex> getVertices()
      Get all the Vertices in Graph.
      Specified by:
      getVertices in interface com.tinkerpop.blueprints.Graph
      Returns:
      Vertices as Iterable
    • getVertices

      public Iterable<com.tinkerpop.blueprints.Vertex> getVertices(boolean iPolymorphic)
      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

      public Iterable<com.tinkerpop.blueprints.Vertex> getVerticesOfClass(String iClassName)
      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 filter
      iPolymorphic - If true consider also Vertex iClassName sub-classes
      Returns:
      Vertices as Iterable
    • getVertices

      public Iterable<com.tinkerpop.blueprints.Vertex> getVertices(String iKey, Object iValue)
      Get all the Vertices in Graph filtering by field name and value. Example: Iterable resultset = getVertices("name", "Jay");
      Specified by:
      getVertices in interface com.tinkerpop.blueprints.Graph
      Parameters:
      iKey - Field name
      iValue - Field value
      Returns:
      Vertices as Iterable
    • getVertexByKey

      @Deprecated public com.tinkerpop.blueprints.Vertex getVertexByKey(String iKey, Object iValue)
      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 property
      iValue - 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: Iterable resultset = getVertices("Person",new String[] {"name","surname"},new Object[] { "Sherlock" ,"Holmes"});
      Parameters:
      iKey - Fields name
      iValue - Fields value
      Returns:
      Vertices as Iterable
    • getEdges

      public Iterable<com.tinkerpop.blueprints.Edge> getEdges()
      Returns all the edges in Graph.
      Specified by:
      getEdges in interface com.tinkerpop.blueprints.Graph
      Returns:
      Edges as Iterable
    • getEdges

      public Iterable<com.tinkerpop.blueprints.Edge> getEdges(boolean iPolymorphic)
      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

      public Iterable<com.tinkerpop.blueprints.Edge> getEdgesOfClass(String iClassName)
      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 filter
      iPolymorphic - If true consider also iClassName Edge sub-classes
      Returns:
      Edges as Iterable
    • getEdges

      public Iterable<com.tinkerpop.blueprints.Edge> getEdges(String iKey, Object value)
      Get all the Edges in Graph filtering by field name and value. Example: Iterable resultset = getEdges("name", "Jay");
      Specified by:
      getEdges in interface com.tinkerpop.blueprints.Graph
      Parameters:
      iKey - Field name
      value - Field value
      Returns:
      Edges as Iterable
    • getEdge

      public OrientEdge getEdge(Object id)
      Returns a edge by an ID.
      Specified by:
      getEdge in interface com.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:
      removeEdge in interface com.tinkerpop.blueprints.Graph
      Parameters:
      edge - Edge to remove
    • reuse

      public OrientBaseGraph reuse(ODatabaseDocumentInternal iDatabase)
      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:
      shutdown in interface com.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

      public String toString()
      Returns the Graph URL.
      Overrides:
      toString in class Object
    • getRawGraph

      public ODatabaseDocumentTx getRawGraph()
      Returns the underlying Database instance as ODatabaseDocumentTx instance.
      Specified by:
      getRawGraph in interface com.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

      public OrientVertexType getVertexBaseType()
      Returns the V persistent class as OrientVertexType instance.
      Specified by:
      getVertexBaseType in interface OrientExtendedGraph
    • getVertexType

      public OrientVertexType getVertexType(String iTypeName)
      Returns the persistent class for type iTypeName as OrientVertexType instance.
      Specified by:
      getVertexType in interface OrientExtendedGraph
      Parameters:
      iTypeName - Vertex class name
    • createVertexType

      public OrientVertexType createVertexType(String iClassName)
      Creates a new Vertex persistent class.
      Specified by:
      createVertexType in interface OrientExtendedGraph
      Parameters:
      iClassName - Vertex class name
      Returns:
      OrientVertexType instance representing the persistent class
    • createVertexType

      public OrientVertexType createVertexType(String iClassName, int clusters)
      Creates a new Vertex persistent class.
      Specified by:
      createVertexType in interface OrientExtendedGraph
      Parameters:
      iClassName - Vertex class name
      clusters - 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

      public OrientVertexType createVertexType(String iClassName, String iSuperClassName)
      Creates a new Vertex persistent class specifying the super class.
      Specified by:
      createVertexType in interface OrientExtendedGraph
      Parameters:
      iClassName - Vertex class name
      iSuperClassName - Vertex class name to extend
      Returns:
      OrientVertexType instance representing the persistent class
    • createVertexType

      public OrientVertexType createVertexType(String iClassName, String iSuperClassName, int clusters)
      Creates a new Vertex persistent class specifying the super class.
      Specified by:
      createVertexType in interface OrientExtendedGraph
      Parameters:
      iClassName - Vertex class name
      iSuperClassName - Vertex class name to extend
      clusters - 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

      public OrientVertexType createVertexType(String iClassName, OClass iSuperClass)
      Creates a new Vertex persistent class specifying the super class.
      Specified by:
      createVertexType in interface OrientExtendedGraph
      Parameters:
      iClassName - Vertex class name
      iSuperClass - OClass Vertex to extend
      Returns:
      OrientVertexType instance representing the persistent class
    • createVertexType

      public OrientVertexType createVertexType(String iClassName, OClass iSuperClass, int clusters)
      Creates a new Vertex persistent class specifying the super class.
      Specified by:
      createVertexType in interface OrientExtendedGraph
      Parameters:
      iClassName - Vertex class name
      iSuperClass - OClass Vertex to extend
      clusters - 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

      public void dropVertexType(String iTypeName)
      Drop a vertex class.
      Specified by:
      dropVertexType in interface OrientExtendedGraph
      Parameters:
      iTypeName - Vertex class name
    • getEdgeBaseType

      public OrientEdgeType getEdgeBaseType()
      Returns the E persistent class as OrientEdgeType instance.
      Specified by:
      getEdgeBaseType in interface OrientExtendedGraph
    • getEdgeType

      public OrientEdgeType getEdgeType(String iTypeName)
      Returns the persistent class for type iTypeName as OrientEdgeType instance.
      Specified by:
      getEdgeType in interface OrientExtendedGraph
      Parameters:
      iTypeName - Edge class name
    • createEdgeType

      public OrientEdgeType createEdgeType(String iClassName)
      Creates a new Edge persistent class.
      Specified by:
      createEdgeType in interface OrientExtendedGraph
      Parameters:
      iClassName - Edge class name
      Returns:
      OrientEdgeType instance representing the persistent class
    • createEdgeType

      public OrientEdgeType createEdgeType(String iClassName, int clusters)
      Creates a new Edge persistent class.
      Parameters:
      iClassName - Edge class name
      clusters - 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

      public OrientEdgeType createEdgeType(String iClassName, String iSuperClassName)
      Creates a new Edge persistent class specifying the super class.
      Specified by:
      createEdgeType in interface OrientExtendedGraph
      Parameters:
      iClassName - Edge class name
      iSuperClassName - Edge class name to extend
      Returns:
      OrientEdgeType instance representing the persistent class
    • createEdgeType

      public OrientEdgeType createEdgeType(String iClassName, String iSuperClassName, int clusters)
      Creates a new Edge persistent class specifying the super class.
      Parameters:
      iClassName - Edge class name
      iSuperClassName - Edge class name to extend
      clusters - 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

      public OrientEdgeType createEdgeType(String iClassName, OClass iSuperClass, int clusters)
      Creates a new Edge persistent class specifying the super class.
      Specified by:
      createEdgeType in interface OrientExtendedGraph
      Parameters:
      iClassName - Edge class name
      iSuperClass - OClass Edge to extend
      clusters - 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

      public OrientEdgeType createEdgeType(String iClassName, OClass iSuperClass)
      Creates a new Edge persistent class specifying the super class.
      Specified by:
      createEdgeType in interface OrientExtendedGraph
      Parameters:
      iClassName - Edge class name
      iSuperClass - OClass Edge to extend
      Returns:
      OrientEdgeType instance representing the persistent class
    • dropEdgeType

      public void dropEdgeType(String iTypeName)
      Drops an edge class.
      Specified by:
      dropEdgeType in interface OrientExtendedGraph
      Parameters:
      iTypeName - Edge class name
    • detach

      public OrientElement detach(OrientElement iElement)
      Detaches a Graph Element to be used offline. All the changes will be committed on further @attach call.
      Specified by:
      detach in interface OrientExtendedGraph
      Parameters:
      iElement - Graph element to detach
      Returns:
      The detached element
      See Also:
    • attach

      public OrientElement attach(OrientElement iElement)
      Attaches a previously detached Graph Element to the current Graph. All the pending changes will be committed.
      Specified by:
      attach in interface OrientExtendedGraph
      Parameters:
      iElement - Graph element to attach
      Returns:
      The attached element
      See Also:
    • getElement

      public OrientElement getElement(Object id)
      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:
      dropKeyIndex in interface com.tinkerpop.blueprints.KeyIndexableGraph
      Parameters:
      key - Field name
      elementClass - 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:
      createKeyIndex in interface com.tinkerpop.blueprints.KeyIndexableGraph
      Type Parameters:
      T - the element class specification
      Parameters:
      key - the key to create the index for
      elementClass - the element class that the index is for
      indexParameters - 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:
      getIndexedKeys in interface com.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 for
      includeClassNames - 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:
      query in interface com.tinkerpop.blueprints.Graph
      Specified by:
      query in interface OrientExtendedGraph
      Returns:
      new GraphQuery instance
    • traverse

      public OTraverse traverse()
      Returns a OTraverse object to start traversing the graph.
      Specified by:
      traverse in interface OrientExtendedGraph
    • command

      public OCommandRequest command(OCommandRequest iCommand)
      Executes commands against the graph. Commands are executed outside transaction.
      Specified by:
      command in interface OrientExtendedGraph
      Parameters:
      iCommand - Command request between SQL, GREMLIN and SCRIPT commands
    • countVertices

      public long countVertices()
      Counts the vertices in graph.
      Specified by:
      countVertices in interface OrientExtendedGraph
      Returns:
      Long as number of total vertices
    • countVertices

      public long countVertices(String iClassName)
      Counts the vertices in graph of a particular class.
      Specified by:
      countVertices in interface OrientExtendedGraph
      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:
      countEdges in interface OrientExtendedGraph
      Returns:
      Long as number of total edges
    • countEdges

      public long countEdges(String iClassName)
      Counts the edges in graph of a particular class. Edge counting works only if useLightweightEdges is false.
      Specified by:
      countEdges in interface OrientExtendedGraph
      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

      protected <T> String getClassName(Class<T> elementClass)
    • convertKey

      protected Object convertKey(OIndex idx, Object iValue)
    • convertKeys

      protected Object[] convertKeys(OIndex idx, Object[] iValue)
    • setCurrentGraphInThreadLocal

      protected void setCurrentGraphInThreadLocal()
    • getDatabase

      protected ODatabaseDocumentInternal 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

      protected static ODocument getDocument(OIdentifiable id, boolean forceReload)
    • deleteEdgeIfAny

      protected static void deleteEdgeIfAny(OIdentifiable iRecord, boolean forceReload)
      (Internal only)
    • getVertexInstance

      protected OrientVertex getVertexInstance(OIdentifiable id)
    • getVertexInstance

      protected OrientVertex getVertexInstance(String className, Object... fields)
    • getEdgeInstance

      protected OrientEdge getEdgeInstance(OIdentifiable id)
    • getEdgeInstance

      protected OrientEdge getEdgeInstance(String className, Object... fields)
    • getEdgeInstance

      protected OrientEdge getEdgeInstance(OIdentifiable from, OIdentifiable to, String label)
    • setUseLightweightEdges

      public OrientConfigurableGraph setUseLightweightEdges(boolean useDynamicEdges)
      Description copied from class: OrientConfigurableGraph
      Changes the setting about usage of lightweight edges.
      Overrides:
      setUseLightweightEdges in class OrientConfigurableGraph
    • setProperty

      protected Object setProperty(String iName, Object iValue)
      Specified by:
      setProperty in class OrientConfigurableGraph
    • getProperty

      protected Object getProperty(String iName)
      Specified by:
      getProperty in class OrientConfigurableGraph
    • getProperties

      public Map<String,Object> getProperties()
      Specified by:
      getProperties in class OrientConfigurableGraph