Class OrientEdge
java.lang.Object
com.tinkerpop.blueprints.impls.orient.OrientElement
com.tinkerpop.blueprints.impls.orient.OrientEdge
- All Implemented Interfaces:
OIdentifiable,OSerializableStream,com.tinkerpop.blueprints.Edge,com.tinkerpop.blueprints.Element,Externalizable,Serializable,Comparable<OIdentifiable>,Comparator<OIdentifiable>
OrientDB Edge implementation of TinkerPop Blueprints standard. Edges can be classic or
lightweight. Lightweight edges have no properties and have no identity on database. Lightweight
edges are created by default when an Edge is created without properties. To disable this option
execute this command against the database:
alter database custom useLightweightEdges=false
.- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com) (http://orientdb.com)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected OIdentifiableprotected OIdentifiableFields inherited from class com.tinkerpop.blueprints.impls.orient.OrientElement
classicDetachMode, DEF_ORIGINAL_ID_FIELDNAME, LABEL_FIELD_NAME, rawElement, settings -
Constructor Summary
ConstructorsModifierConstructorDescription(Internal) Called by serializationprotectedOrientEdge(OrientBaseGraph rawGraph, OIdentifiable rawEdge) protectedOrientEdge(OrientBaseGraph rawGraph, OIdentifiable out, OIdentifiable in, String iLabel) protectedOrientEdge(OrientBaseGraph rawGraph, OIdentifiable rawEdge, String iLabel) protectedOrientEdge(OrientBaseGraph rawGraph, String iLabel, Object... fields) -
Method Summary
Modifier and TypeMethodDescriptionvoid(Blueprints Extension) Converts the lightweight edge to a regular edge creating the underlying document to store edge's properties.protected ODocumentcreateDocument(String iLabel) protected booleandropEdgeFromVertex(OIdentifiable iEdge, ODocument iVertex, String iFieldName, Object iFieldValue) booleanfinal String(Blueprints Extension) Returns "E" as base class name all the edge's sub-classes extend.getClassName(String iLabel) (Blueprints Extension) Returns the class name based on graph settings.static OIdentifiablegetConnection(ODocument iEdgeRecord, com.tinkerpop.blueprints.Direction iDirection) (Blueprints Extension) Returns "Edge".getId()Returns the Edge Id assuring to save it if it's transient yet.(Blueprints Extension) Returns the incoming vertex in form of record.getLabel()Returns the Edge's label.(Blueprints Extension) Returns the outgoing vertex in form of record.(Blueprints Extension) Gets all the properties from a Vertex or Edge in one shot.<T> TgetProperty(String key) Returns a Property value.Returns all the Property names as Set of String.(Blueprints Extension) Returns the underlying record if it's a regular edge, otherwise it created a document with no identity with the edge properties.static StringgetRecordLabel(OIdentifiable iEdge) (Blueprints Extension) Returns the record label if any, otherwise NULL.getType()getVertex(com.tinkerpop.blueprints.Direction direction) Returns the connected incoming or outgoing vertex.booleanReturns true if the edge is labeled with any of the passed strings.static boolean(Blueprints Extension) Returns true if the edge is labeled with any of the passed strings.booleanvoidvoidremove()Removes the Edge from the Graph.<T> TremoveProperty(String key) Removed a Property.voidsetProperty(String key, Object value) Set a Property value.toString()Returns a string representation of the edge.voidMethods inherited from class com.tinkerpop.blueprints.impls.orient.OrientElement
attach, checkClass, checkDeletedInTx, checkForClassInSchema, checkIfAttached, compare, compareTo, copyTo, detach, fromStream, getGraph, getIdentity, hashCode, isDetached, isLocked, lock, lockingStrategy, reload, save, save, setCurrentGraphInThreadLocal, setProperties, setPropertiesInternal, setProperty, setPropertyInternal, switchToAutoAttachmentMode, switchToManualAttachmentMode, toStream, unlock, validatePropertyMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
vOut
-
vIn
-
label
-
-
Constructor Details
-
OrientEdge
public OrientEdge()(Internal) Called by serialization -
OrientEdge
-
OrientEdge
-
OrientEdge
-
OrientEdge
-
-
Method Details
-
getConnection
public static OIdentifiable getConnection(ODocument iEdgeRecord, com.tinkerpop.blueprints.Direction iDirection) -
isLabeled
(Blueprints Extension) Returns true if the edge is labeled with any of the passed strings.- Parameters:
iEdgeLabel- Label of current edgeiLabels- Labels as array of Strings- Returns:
- true if the edge is labeled with any of the passed strings
-
getRecordLabel
(Blueprints Extension) Returns the record label if any, otherwise NULL.- Parameters:
iEdge- Edge instance
-
getType
-
getVertex
Returns the connected incoming or outgoing vertex.- Specified by:
getVertexin interfacecom.tinkerpop.blueprints.Edge- Parameters:
direction- Direction between IN or OUT
-
getOutVertex
(Blueprints Extension) Returns the outgoing vertex in form of record. -
getInVertex
(Blueprints Extension) Returns the incoming vertex in form of record. -
getLabel
Returns the Edge's label. By default OrientDB binds the Blueprints Label concept to Edge Class. To disable this feature execute this at database levelalter database custom useClassForEdgeLabel=false- Specified by:
getLabelin interfacecom.tinkerpop.blueprints.Edge- Specified by:
getLabelin classOrientElement
-
equals
- Specified by:
equalsin interfaceComparator<OIdentifiable>- Overrides:
equalsin classOrientElement
-
getId
Returns the Edge Id assuring to save it if it's transient yet.- Specified by:
getIdin interfacecom.tinkerpop.blueprints.Element- Overrides:
getIdin classOrientElement
-
getProperty
Returns a Property value.- Specified by:
getPropertyin interfacecom.tinkerpop.blueprints.Element- Overrides:
getPropertyin classOrientElement- Parameters:
key- Property name- Returns:
- Property value if any, otherwise NULL.
-
isLightweight
public boolean isLightweight() -
getPropertyKeys
Returns all the Property names as Set of String. out, in and label are not returned as properties even if are part of the underlying document because are considered internal properties.- Specified by:
getPropertyKeysin interfacecom.tinkerpop.blueprints.Element
-
getProperties
Description copied from class:OrientElement(Blueprints Extension) Gets all the properties from a Vertex or Edge in one shot.- Specified by:
getPropertiesin classOrientElement- Returns:
- a map containing all the properties of the Vertex/Edge.
-
setProperty
Set a Property value. If the edge is lightweight, it's transparently transformed into a regular edge.- Specified by:
setPropertyin interfacecom.tinkerpop.blueprints.Element- Overrides:
setPropertyin classOrientElement- Parameters:
key- Property namevalue- Property value
-
removeProperty
Removed a Property.- Specified by:
removePropertyin interfacecom.tinkerpop.blueprints.Element- Overrides:
removePropertyin classOrientElement- Parameters:
key- Property name- Returns:
- Old value if any
-
remove
public void remove()Removes the Edge from the Graph. Connected vertices aren't removed.- Specified by:
removein interfacecom.tinkerpop.blueprints.Element
-
getBaseClassName
(Blueprints Extension) Returns "E" as base class name all the edge's sub-classes extend.- Specified by:
getBaseClassNamein classOrientElement
-
getElementType
(Blueprints Extension) Returns "Edge".- Specified by:
getElementTypein classOrientElement
-
toString
Returns a string representation of the edge. -
getRecord
(Blueprints Extension) Returns the underlying record if it's a regular edge, otherwise it created a document with no identity with the edge properties.- Specified by:
getRecordin interfaceOIdentifiable- Overrides:
getRecordin classOrientElement- Returns:
- ORecord instance
-
convertToDocument
public void convertToDocument()(Blueprints Extension) Converts the lightweight edge to a regular edge creating the underlying document to store edge's properties. -
getClassName
(Blueprints Extension) Returns the class name based on graph settings. -
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classOrientElement- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classOrientElement- Throws:
IOExceptionClassNotFoundException
-
isLabeled
Returns true if the edge is labeled with any of the passed strings.- Parameters:
iLabels- Labels as array of Strings- Returns:
- true if the edge is labeled with any of the passed strings
-
createDocument
-
dropEdgeFromVertex
protected boolean dropEdgeFromVertex(OIdentifiable iEdge, ODocument iVertex, String iFieldName, Object iFieldValue)
-