public class OVertexDelegate extends Object implements OVertex
ORecordElement.STATUS
Constructor and Description |
---|
OVertexDelegate(ODocument entry) |
Modifier and Type | Method and Description |
---|---|
OEdge |
addEdge(OVertex to) |
OEdge |
addEdge(OVertex to,
OClass type) |
OEdge |
addEdge(OVertex to,
String type) |
Optional<OEdge> |
asEdge()
Returns an instance of OEdge representing current element
|
Optional<OVertex> |
asVertex()
Returns an instance of OVertex representing current element
|
<RET extends ORecord> |
clear()
All the fields are deleted but the record identity is maintained.
|
int |
compare(OIdentifiable o1,
OIdentifiable o2) |
int |
compareTo(OIdentifiable o) |
<RET extends ORecord> |
copy()
Creates a copy of the record.
|
static Object |
createLink(ODocument iFromVertex,
OIdentifiable iTo,
String iFieldName)
(Internal only) Creates a link between a vertices and a Graph Element.
|
OVertex |
delete()
Deletes the record from the database.
|
static void |
deleteLinks(OVertex delegate) |
boolean |
detach()
Removes all the dependencies with other records.
|
protected static void |
detachEdge(OVertex vertex,
OEdge edge,
String fieldPrefix) |
protected static void |
detachIncomingEdge(OVertex vertex,
OEdge edge) |
protected static void |
detachOutgointEdge(OVertex vertex,
OEdge edge) |
boolean |
equals(Object obj) |
<RET extends ORecord> |
fromJSON(String iJson)
Fills the record parsing the content in JSON format.
|
OSerializableStream |
fromStream(byte[] iStream)
Unmarshalls the object.
|
protected OPair<ODirection,String> |
getConnection(ODirection iDirection,
String iFieldName,
String... iClassNames) |
static String |
getConnectionFieldName(ODirection iDirection,
String iClassName,
boolean useVertexFieldsForEdgeLabels) |
ODatabaseDocument |
getDatabase()
Returns the database where the record belongs.
|
protected Set<String> |
getEdgeFieldNames(ODirection iDirection,
String... iClassNames) |
Iterable<OEdge> |
getEdges(ODirection direction) |
Iterable<OEdge> |
getEdges(ODirection direction,
OClass... type) |
Iterable<OEdge> |
getEdges(ODirection direction,
String... labels) |
ORID |
getIdentity()
Returns the record identity as <cluster-id>:<cluster-position>
|
ORecordElement.STATUS |
getInternalStatus()
Returns the current status of the record.
|
ORecordElement |
getOwner() |
<RET> RET |
getProperty(String name)
Gets a property given its name
|
Set<String> |
getPropertyNames()
Returns all the names of defined properties
|
<T extends ORecord> |
getRecord()
Returns the record instance.
|
Optional<OClass> |
getSchemaType()
Returns the type of current element, ie the class in the schema (if any)
|
int |
getSize()
Returns the size in bytes of the record.
|
int |
getVersion()
Returns the current version number of the record.
|
Iterable<OVertex> |
getVertices(ODirection direction) |
Iterable<OVertex> |
getVertices(ODirection direction,
OClass... type) |
Iterable<OVertex> |
getVertices(ODirection direction,
String... type) |
int |
hashCode() |
boolean |
hasProperty(String propertyName)
Check if a property exists in the Element
|
boolean |
isDirty()
Checks if the record is dirty, namely if it was changed in memory.
|
boolean |
isEdge()
return true if the current element is an edge
|
boolean |
isLocked() |
boolean |
isVertex()
return true if the current element is a vertex
|
<RET extends ORecord> |
load()
Loads the record content in memory.
|
void |
lock(boolean iExclusive) |
OStorage.LOCKING_STRATEGY |
lockingStrategy() |
ORID |
moveTo(String iClassName,
String iClusterName) |
<RET extends ORecord> |
reload()
Loads the record content in memory.
|
<RET extends ORecord> |
reload(String fetchPlan,
boolean ignoreCache,
boolean force) |
<RET> RET |
removeProperty(String name)
Remove a property
|
static void |
replaceLinks(ODocument iVertex,
String iFieldName,
OIdentifiable iVertexToRemove,
OIdentifiable iNewVertex) |
<RET extends ORecord> |
reset()
Resets the record to be reused.
|
<RET extends ORecord> |
save()
Saves in-memory changes to the database.
|
<RET extends ORecord> |
save(boolean forceCreate) |
<RET extends ORecord> |
save(String iCluster)
Saves in-memory changes to the database defining a specific cluster where to save it.
|
<RET extends ORecord> |
save(String iCluster,
boolean forceCreate) |
<RET> RET |
setDirty()
Marks the instance as dirty.
|
void |
setDirtyNoChanged() |
void |
setInternalStatus(ORecordElement.STATUS iStatus)
Changes the current internal status.
|
void |
setProperty(String name,
Object value)
Sets a property value
|
void |
setProperty(String name,
Object value,
OType... fieldType)
Sets a property value
|
String |
toJSON()
Exports the record in JSON format.
|
String |
toJSON(String iFormat)
Exports the record in JSON format specifying additional formatting settings.
|
byte[] |
toStream()
Marshalls the object.
|
String |
toString() |
<RET extends ORecord> |
unload()
Unloads current record.
|
void |
unlock() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
protected final ODocument element
public OVertexDelegate(ODocument entry)
public Iterable<OEdge> getEdges(ODirection direction)
public Iterable<OEdge> getEdges(ODirection direction, String... labels)
public Iterable<OEdge> getEdges(ODirection direction, OClass... type)
public Iterable<OVertex> getVertices(ODirection direction)
getVertices
in interface OVertex
public Iterable<OVertex> getVertices(ODirection direction, String... type)
getVertices
in interface OVertex
public Iterable<OVertex> getVertices(ODirection direction, OClass... type)
getVertices
in interface OVertex
public OVertex delete()
ORecord
public static void deleteLinks(OVertex delegate)
public Set<String> getPropertyNames()
OElement
getPropertyNames
in interface OElement
public <RET> RET getProperty(String name)
OElement
getProperty
in interface OElement
name
- the property namepublic boolean hasProperty(String propertyName)
OElement
hasProperty
in interface OElement
public void setProperty(String name, Object value)
OElement
setProperty
in interface OElement
name
- the property namevalue
- the property valuepublic void setProperty(String name, Object value, OType... fieldType)
OElement
setProperty
in interface OElement
name
- the property namevalue
- the property valuefieldType
- Forced type (not auto-determined)public <RET> RET removeProperty(String name)
OElement
removeProperty
in interface OElement
name
- the property namepublic Optional<OVertex> asVertex()
OElement
public Optional<OEdge> asEdge()
OElement
public boolean isVertex()
OElement
public boolean isEdge()
OElement
public Optional<OClass> getSchemaType()
OElement
getSchemaType
in interface OElement
public <T extends ORecord> T getRecord()
OIdentifiable
getRecord
in interface OIdentifiable
public void lock(boolean iExclusive)
lock
in interface OIdentifiable
public boolean isLocked()
isLocked
in interface OIdentifiable
public OStorage.LOCKING_STRATEGY lockingStrategy()
lockingStrategy
in interface OIdentifiable
public void unlock()
unlock
in interface OIdentifiable
public int compareTo(OIdentifiable o)
compareTo
in interface Comparable<OIdentifiable>
public int compare(OIdentifiable o1, OIdentifiable o2)
compare
in interface Comparator<OIdentifiable>
protected OPair<ODirection,String> getConnection(ODirection iDirection, String iFieldName, String... iClassNames)
protected Set<String> getEdgeFieldNames(ODirection iDirection, String... iClassNames)
public static Object createLink(ODocument iFromVertex, OIdentifiable iTo, String iFieldName)
public boolean equals(Object obj)
equals
in interface Comparator<OIdentifiable>
equals
in class Object
public ORecordElement.STATUS getInternalStatus()
ORecord
getInternalStatus
in interface ORecord
STATUS
public void setInternalStatus(ORecordElement.STATUS iStatus)
ORecord
setInternalStatus
in interface ORecord
iStatus
- status between the values defined in the enum STATUS
public <RET> RET setDirty()
ORecordElement
setDirty
in interface ORecordElement
public void setDirtyNoChanged()
setDirtyNoChanged
in interface ORecordElement
public ORecordElement getOwner()
getOwner
in interface ORecordElement
public byte[] toStream() throws OSerializationException
OSerializableStream
toStream
in interface OSerializableStream
OSerializationException
- if the marshalling does not succeedOSerializableStream.fromStream(byte[])
public OSerializableStream fromStream(byte[] iStream) throws OSerializationException
OSerializableStream
fromStream
in interface OSerializableStream
iStream
- byte array representation of the objectOSerializationException
- if the unmarshalling does not succeedpublic boolean detach()
ORecord
public <RET extends ORecord> RET reset()
ORecord
public <RET extends ORecord> RET unload()
ORecord
public <RET extends ORecord> RET clear()
ORecord
public <RET extends ORecord> RET copy()
ORecord
public ORID getIdentity()
ORecord
getIdentity
in interface OIdentifiable
getIdentity
in interface ORecord
public int getVersion()
ORecord
getVersion
in interface ORecord
OTransactionOptimistic
public ODatabaseDocument getDatabase()
ORecord
getDatabase
in interface ORecord
public boolean isDirty()
ORecord
public <RET extends ORecord> RET load() throws ORecordNotFoundException
ORecord
load
in interface ORecord
ORecordNotFoundException
public <RET extends ORecord> RET reload() throws ORecordNotFoundException
ORecord
reload
in interface ORecord
ORecordNotFoundException
public <RET extends ORecord> RET reload(String fetchPlan, boolean ignoreCache, boolean force) throws ORecordNotFoundException
reload
in interface ORecord
ORecordNotFoundException
public <RET extends ORecord> RET save()
ORecord
public <RET extends ORecord> RET save(String iCluster)
ORecord
public <RET extends ORecord> RET save(boolean forceCreate)
public <RET extends ORecord> RET fromJSON(String iJson)
ORecord
public String toJSON()
ORecord
public String toJSON(String iFormat)
ORecord
toJSON
in interface ORecord
iFormat
- Format settings separated by comma. Available settings are:
public int getSize()
ORecord
public static String getConnectionFieldName(ODirection iDirection, String iClassName, boolean useVertexFieldsForEdgeLabels)
public static void replaceLinks(ODocument iVertex, String iFieldName, OIdentifiable iVertexToRemove, OIdentifiable iNewVertex)
Copyright © 2009–2020 OrientDB. All rights reserved.