public abstract class OrientElement extends Object implements com.tinkerpop.blueprints.Element, OSerializableStream, Externalizable, OIdentifiable
| Modifier and Type | Field and Description |
|---|---|
static Object |
DEF_ORIGINAL_ID_FIELDNAME |
protected OrientBaseGraph |
graph |
static String |
LABEL_FIELD_NAME |
protected OIdentifiable |
rawElement |
protected OrientBaseGraph.Settings |
settings |
| Modifier | Constructor and Description |
|---|---|
protected |
OrientElement(OrientBaseGraph rawGraph,
OIdentifiable iRawElement) |
| Modifier and Type | Method and Description |
|---|---|
OrientElement |
attach(OrientBaseGraph iNewGraph)
(Blueprints Extension) Replaces current graph instance with new one on @detach -ed elements.
|
protected void |
checkClass() |
protected String |
checkForClassInSchema(String iClassName)
Check if a class already exists, otherwise create it at the fly.
|
protected void |
checkIfAttached() |
int |
compare(OIdentifiable iFirst,
OIdentifiable iSecond) |
int |
compareTo(OIdentifiable iOther) |
OrientElement |
detach()
(Blueprints Extension) Removes the reference to the current graph instance to let working offline.
|
boolean |
equals(Object object) |
OSerializableStream |
fromStream(byte[] iStream)
(Blueprints Extension) Fills the Element from a byte[]
|
abstract String |
getBaseClassName() |
abstract String |
getElementType()
(Blueprints Extension) Returns the element type in form of String between "Vertex" and "Edge".
|
OrientBaseGraph |
getGraph()
(Blueprints Extension) Returns the Graph instance associated to the current element.
|
Object |
getId()
Returns the Element Id assuring to save it if it's transient yet.
|
ORID |
getIdentity()
(Blueprints Extension) Returns the record's identity.
|
<T> T |
getProperty(String key)
Returns a Property value.
|
ODocument |
getRecord()
(Blueprints Extension) Returns the underlying record.
|
int |
hashCode() |
boolean |
isDetached()
(Blueprints Extension) Tells if the current element has been @detach ed.
|
void |
lock(boolean iExclusive)
(Blueprints Extension) Locks current Element to prevent concurrent access.
|
void |
readExternal(ObjectInput in) |
void |
remove()
Removes the Element from the Graph.
|
<T> T |
removeProperty(String key)
Removed a Property.
|
void |
save()
(Blueprints Extension) Saves current element.
|
void |
save(String iClusterName)
(Blueprints Extension) Saves current element to a particular cluster.
|
protected void |
setCurrentGraphInThreadLocal() |
<T extends OrientElement> |
setProperties(Object... fields)
(Blueprints Extension) Sets multiple properties in one shot against Vertices and Edges.
|
void |
setProperty(String key,
Object value)
Set a Property value.
|
protected void |
setPropertyInternal(com.tinkerpop.blueprints.Element element,
ODocument doc,
String key,
Object value) |
byte[] |
toStream()
(Blueprints Extension) Serializes the Element as byte[]
|
void |
unlock()
(Blueprints Extension) Unlocks previous acquired @lock against the Element.
|
void |
validateProperty(com.tinkerpop.blueprints.Element element,
String key,
Object value)
(Blueprints Extension) Validates an Element property.
|
void |
writeExternal(ObjectOutput out) |
public static final String LABEL_FIELD_NAME
public static final Object DEF_ORIGINAL_ID_FIELDNAME
protected transient OrientBaseGraph graph
protected transient OrientBaseGraph.Settings settings
protected OIdentifiable rawElement
protected OrientElement(OrientBaseGraph rawGraph, OIdentifiable iRawElement)
public abstract String getBaseClassName()
public abstract String getElementType()
public void remove()
remove in interface com.tinkerpop.blueprints.Elementpublic <T extends OrientElement> T setProperties(Object... fields)
vertex.setProperties( "name", "Jill", "age", 33, "city", "Rome", "born", "Victoria, TX" );
You can also pass a Map of values as first argument. In this case all the map entries will be set as element
properties:
Map props = new HashMap();
props.put("name", "Jill");
props.put("age", 33);
props.put("city", "Rome");
props.put("born", "Victoria, TX");
vertex.setProperties(props);
T - fields - Odd number of fields to set as repeating pairs of key, value, or if one parameter is received and it's a Map, the Map
entries are used as field key/value pairs.public void setProperty(String key, Object value)
setProperty in interface com.tinkerpop.blueprints.Elementkey - Property namevalue - Property valuepublic <T> T removeProperty(String key)
removeProperty in interface com.tinkerpop.blueprints.Elementkey - Property namepublic <T> T getProperty(String key)
getProperty in interface com.tinkerpop.blueprints.Elementkey - Property namepublic Object getId()
getId in interface com.tinkerpop.blueprints.Elementpublic void save()
public void save(String iClusterName)
iClusterName - Cluster name or null to use the default "E"public byte[] toStream()
throws OSerializationException
toStream in interface OSerializableStreamOSerializationExceptionpublic OSerializableStream fromStream(byte[] iStream) throws OSerializationException
fromStream in interface OSerializableStreamiStream - byte array representation of the objectOSerializationExceptionpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void lock(boolean iExclusive)
lock in interface OIdentifiableiExclusive - True = Exclusive Lock, False = Shared Locklock(boolean)public void unlock()
unlock in interface OIdentifiablelock(boolean)public ORID getIdentity()
getIdentity in interface OIdentifiablepublic ODocument getRecord()
getRecord in interface OIdentifiablepublic OrientElement detach()
#attach(OrientBaseGraph), #isDetachedpublic OrientElement attach(OrientBaseGraph iNewGraph)
iNewGraph - The new Graph instance to use.#detach(), #isDetachedpublic boolean isDetached()
#attach(OrientBaseGraph), #detachpublic boolean equals(Object object)
equals in interface Comparator<OIdentifiable>equals in class Objectpublic int compare(OIdentifiable iFirst, OIdentifiable iSecond)
compare in interface Comparator<OIdentifiable>public int compareTo(OIdentifiable iOther)
compareTo in interface Comparable<OIdentifiable>public OrientBaseGraph getGraph()
public final void validateProperty(com.tinkerpop.blueprints.Element element,
String key,
Object value)
throws IllegalArgumentException
element - Element instancekey - Property namevalue - property valueIllegalArgumentExceptionprotected void checkClass()
protected String checkForClassInSchema(String iClassName)
iClassName - Class's nameprotected void setPropertyInternal(com.tinkerpop.blueprints.Element element,
ODocument doc,
String key,
Object value)
protected void setCurrentGraphInThreadLocal()
protected void checkIfAttached()
Copyright © 2009-2014 Orient Technologies. All Rights Reserved.