public class OrientVertex extends OrientElement implements OrientExtendedVertex
Modifier and Type | Field and Description |
---|---|
static String |
CONNECTION_IN_PREFIX |
static String |
CONNECTION_OUT_PREFIX |
classicDetachMode, DEF_ORIGINAL_ID_FIELDNAME, LABEL_FIELD_NAME, rawElement, settings
Modifier | Constructor and Description |
---|---|
|
OrientVertex()
(Internal) Called by serialization.
|
|
OrientVertex(OrientBaseGraph graph,
OIdentifiable record) |
protected |
OrientVertex(OrientBaseGraph graph,
String className,
Object... fields) |
Modifier and Type | Method and Description |
---|---|
OrientEdge |
addEdge(String label,
OrientVertex inVertex,
Object[] fields)
Creates an edge between current Vertex and a target Vertex setting label as Edge's label.
|
OrientEdge |
addEdge(String label,
OrientVertex inVertex,
String iClassName)
Creates an edge between current Vertex and a target Vertex setting label as Edge's label.
|
OrientEdge |
addEdge(String label,
OrientVertex inVertex,
String iClassName,
String iClusterName,
Object... fields)
Creates an edge between current Vertex and a target Vertex setting label as Edge's label.
|
com.tinkerpop.blueprints.Edge |
addEdge(String label,
com.tinkerpop.blueprints.Vertex inVertex)
Creates an edge between current Vertex and a target Vertex setting label as Edge's label.
|
protected void |
addSingleEdge(ODocument doc,
OMultiCollectionIterator<com.tinkerpop.blueprints.Edge> iterable,
String fieldName,
OPair<com.tinkerpop.blueprints.Direction,String> connection,
Object fieldValue,
OIdentifiable iTargetVertex,
String[] iLabels) |
OrientVertex |
copy() |
long |
countEdges(com.tinkerpop.blueprints.Direction iDirection,
String... iLabels)
(Blueprints Extension) Returns the number of edges connected to the current Vertex.
|
static Object |
createLink(OrientBaseGraph iGraph,
ODocument iFromVertex,
OIdentifiable iTo,
String iFieldName)
(Internal only) Creates a link between a vertices and a Graph Element.
|
Object |
execute(OCommandPredicate iPredicate)
(Blueprints Extension) Executes the command predicate against current vertex.
|
String |
getBaseClassName()
(Blueprints Extension) Returns "V" as base class name all the vertex sub-classes extend.
|
protected OPair<com.tinkerpop.blueprints.Direction,String> |
getConnection(com.tinkerpop.blueprints.Direction iDirection,
String iFieldName,
String... iClassNames)
Determines if a field is a connections or not.
|
String |
getConnectionClass(com.tinkerpop.blueprints.Direction iDirection,
String iFieldName)
Used to extract the class name from the vertex's field.
|
static com.tinkerpop.blueprints.Direction |
getConnectionDirection(String iConnectionField,
boolean useVertexFieldsForEdgeLabels) |
static String |
getConnectionFieldName(com.tinkerpop.blueprints.Direction iDirection,
String iClassName,
boolean useVertexFieldsForEdgeLabels)
(Internal only) Returns the field name used for the relationship.
|
protected static OrientEdge |
getEdge(OrientBaseGraph graph,
ODocument doc,
String fieldName,
OPair<com.tinkerpop.blueprints.Direction,String> connection,
Object fieldValue,
OIdentifiable iTargetVertex,
String[] iLabels)
(Internal only)
|
Iterable<com.tinkerpop.blueprints.Edge> |
getEdges(com.tinkerpop.blueprints.Direction iDirection,
String... iLabels)
Returns the edges connected to the current Vertex.
|
Iterable<com.tinkerpop.blueprints.Edge> |
getEdges(OrientVertex iDestination,
com.tinkerpop.blueprints.Direction iDirection,
String... iLabels)
(Blueprints Extension) Returns all the edges from the current Vertex to another one.
|
String |
getElementType()
(Blueprints Extension) Returns "Vertex".
|
static String |
getInverseConnectionFieldName(String iFieldName,
boolean useVertexFieldsForEdgeLabels)
(Internal only)
|
String |
getLabel()
(Blueprints Extension) Returns the Vertex's label.
|
Map<String,Object> |
getProperties()
(Blueprints Extension) Gets all the properties from a Vertex or Edge in one shot.
|
Set<String> |
getPropertyKeys()
Returns all the Property names as Set of String.
|
OrientVertexType |
getType()
(Blueprints Extension) Returns the Vertex type as OrientVertexType object.
|
OrientVertex |
getVertexInstance() |
Iterable<com.tinkerpop.blueprints.Vertex> |
getVertices(com.tinkerpop.blueprints.Direction iDirection,
String... iLabels)
Returns a lazy iterable instance against vertices.
|
ORID |
moveTo(String iClassName,
String iClusterName)
Moves current vertex to another class/cluster.
|
ORID |
moveToClass(String iClassName)
Moves current vertex to another class.
|
ORID |
moveToCluster(String iClusterName)
Moves current vertex to another cluster.
|
OrientVertexQuery |
query()
Executes a query against the current vertex.
|
void |
remove()
Removes the current Vertex from the Graph.
|
static void |
replaceLinks(ODocument iVertex,
String iFieldName,
OIdentifiable iVertexToRemove,
OIdentifiable iNewVertex)
(Internal only)
|
String |
toString()
Returns a string representation of the vertex.
|
OTraverse |
traverse()
Returns a OTraverse object to start traversing from the current vertex.
|
attach, checkClass, checkDeletedInTx, checkForClassInSchema, checkIfAttached, compare, compareTo, copyTo, detach, equals, fromStream, getGraph, getId, getIdentity, getProperty, getRecord, hashCode, isDetached, isLocked, lock, lockingStrategy, readExternal, reload, removeProperty, save, save, setCurrentGraphInThreadLocal, setProperties, setPropertiesInternal, setProperty, setProperty, setPropertyInternal, switchToAutoAttachmentMode, switchToManualAttachmentMode, toStream, unlock, validateProperty, writeExternal
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
attach, getIdentity, getRecord, reload
getId, getProperty, removeProperty, setProperty
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static final String CONNECTION_OUT_PREFIX
public static final String CONNECTION_IN_PREFIX
public OrientVertex()
protected OrientVertex(OrientBaseGraph graph, String className, Object... fields)
public OrientVertex(OrientBaseGraph graph, OIdentifiable record)
public static String getConnectionFieldName(com.tinkerpop.blueprints.Direction iDirection, String iClassName, boolean useVertexFieldsForEdgeLabels)
iDirection
- Direction between IN, OUT or BOTHiClassName
- Class name if anyuseVertexFieldsForEdgeLabels
- Graph setting about using the edge label as vertex's fieldpublic static Object createLink(OrientBaseGraph iGraph, ODocument iFromVertex, OIdentifiable iTo, String iFieldName)
public static com.tinkerpop.blueprints.Direction getConnectionDirection(String iConnectionField, boolean useVertexFieldsForEdgeLabels)
public static String getInverseConnectionFieldName(String iFieldName, boolean useVertexFieldsForEdgeLabels)
public static void replaceLinks(ODocument iVertex, String iFieldName, OIdentifiable iVertexToRemove, OIdentifiable iNewVertex)
protected static OrientEdge getEdge(OrientBaseGraph graph, ODocument doc, String fieldName, OPair<com.tinkerpop.blueprints.Direction,String> connection, Object fieldValue, OIdentifiable iTargetVertex, String[] iLabels)
public OrientVertex copy()
copy
in interface OrientExtendedVertex
public OrientVertex getVertexInstance()
getVertexInstance
in interface OrientExtendedVertex
public Object execute(OCommandPredicate iPredicate)
Iterable friendsOfFriends = (Iterable) luca.execute(new OSQLPredicate("out().out('Friend').out('Friend')"));
iPredicate
- Predicate to evaluate. Use OSQLPredicate to use SQLpublic Set<String> getPropertyKeys()
getPropertyKeys
in interface com.tinkerpop.blueprints.Element
public Map<String,Object> getProperties()
OrientElement
getProperties
in class OrientElement
public Iterable<com.tinkerpop.blueprints.Vertex> getVertices(com.tinkerpop.blueprints.Direction iDirection, String... iLabels)
getVertices
in interface com.tinkerpop.blueprints.Vertex
iDirection
- The direction between OUT, IN or BOTHiLabels
- Optional varargs of Strings representing edge label to considerpublic OrientVertexQuery query()
query
in interface com.tinkerpop.blueprints.Vertex
public OTraverse traverse()
public void remove()
remove
in interface com.tinkerpop.blueprints.Element
public ORID moveToClass(String iClassName)
iClassName
- New class name to assignmoveToCluster(String)
,
moveTo(String, String)
public ORID moveToCluster(String iClusterName)
iClusterName
- Cluster name where to save the new vertexmoveToClass(String)
,
moveTo(String, String)
public ORID moveTo(String iClassName, String iClusterName)
iClassName
- New class name to assigniClusterName
- Cluster name where to save the new vertexmoveToClass(String)
,
moveToCluster(String)
public com.tinkerpop.blueprints.Edge addEdge(String label, com.tinkerpop.blueprints.Vertex inVertex)
addEdge
in interface com.tinkerpop.blueprints.Vertex
label
- Edge's label or classinVertex
- Outgoing target vertexpublic OrientEdge addEdge(String label, OrientVertex inVertex, String iClassName)
label
- Edge's label or classinVertex
- Outgoing target vertexiClassName
- Edge's class namepublic OrientEdge addEdge(String label, OrientVertex inVertex, Object[] fields)
label
- Edge's label or classinVertex
- Outgoing target vertexfields
- Fields must be a odd pairs of key/value or a single object as Map containing
entries as key/value pairspublic OrientEdge addEdge(String label, OrientVertex inVertex, String iClassName, String iClusterName, Object... fields)
label
- Edge's label or classinVertex
- Outgoing target vertexfields
- Fields must be a odd pairs of key/value or a single object as Map containing
entries as key/value pairsiClassName
- Edge's class nameiClusterName
- The cluster name where to store the edge recordpublic long countEdges(com.tinkerpop.blueprints.Direction iDirection, String... iLabels)
iDirection
- The direction between OUT, IN or BOTHiLabels
- Optional labels as Strings to considerpublic Iterable<com.tinkerpop.blueprints.Edge> getEdges(com.tinkerpop.blueprints.Direction iDirection, String... iLabels)
getEdges
in interface com.tinkerpop.blueprints.Vertex
iDirection
- The direction between OUT, IN or BOTHiLabels
- Optional labels as Strings to considerpublic Iterable<com.tinkerpop.blueprints.Edge> getEdges(OrientVertex iDestination, com.tinkerpop.blueprints.Direction iDirection, String... iLabels)
iDestination
- The target vertexiDirection
- The direction between OUT, IN or BOTHiLabels
- Optional labels as Strings to considerpublic String getLabel()
alter database custom useClassForVertexLabel=false
getLabel
in class OrientElement
public String getBaseClassName()
getBaseClassName
in class OrientElement
public String getElementType()
getElementType
in class OrientElement
public OrientVertexType getType()
getType
in interface OrientExtendedVertex
public String toString()
public String getConnectionClass(com.tinkerpop.blueprints.Direction iDirection, String iFieldName)
iDirection
- Direction of connectioniFieldName
- Full field nameprotected OPair<com.tinkerpop.blueprints.Direction,String> getConnection(com.tinkerpop.blueprints.Direction iDirection, String iFieldName, String... iClassNames)
iDirection
- Direction to checkiFieldName
- Field nameiClassNames
- Optional array of class namesprotected void addSingleEdge(ODocument doc, OMultiCollectionIterator<com.tinkerpop.blueprints.Edge> iterable, String fieldName, OPair<com.tinkerpop.blueprints.Direction,String> connection, Object fieldValue, OIdentifiable iTargetVertex, String[] iLabels)
Copyright © 2009–2020 OrientDB. All rights reserved.