Class ORecordId
java.lang.Object
com.orientechnologies.orient.core.id.ORecordId
- All Implemented Interfaces:
OIdentifiable,ORID,OSerializableStream,Serializable,Comparable<OIdentifiable>,Comparator<OIdentifiable>
- Direct Known Subclasses:
OContextualRecordId,OImmutableRecordId
- See Also:
-
Field Summary
FieldsFields inherited from interface com.orientechnologies.orient.core.id.ORID
CLUSTER_ID_INVALID, CLUSTER_MAX, CLUSTER_POS_INVALID, PREFIX, SEPARATOR, VERSION_POS_INVALID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompare(OIdentifiable iObj1, OIdentifiable iObj2) intcompareTo(OIdentifiable iOther) copy()voidstatic ORecordIddeserialize(DataInput input) booleanfromStream(byte[] iBuffer) Unmarshalls the object.fromStream(OMemoryStream iStream) voidfromStream(DataInput in) fromStream(InputStream iStream) voidfromString(String iRecordId) static StringgenerateString(int iClusterId, long iPosition) intlongReturns the record identity.<T extends ORecord>
TReturns the record instance.inthashCode()static booleanbooleanisLocked()booleanisNew()static booleanisNew(long pos) booleanstatic booleanisPersistent(long pos) booleanstatic booleanisTemporary(long clusterPosition) booleanisValid()static booleanisValid(long pos) voidlock(boolean iExclusive) UseODatabase.lock(ORID)instead.next()nextRid()Deprecated since v2.2voidreset()static voidserialize(ORID id, DataOutput output) voidsetClusterId(int clusterId) voidsetClusterPosition(long clusterPosition) byte[]toStream()Marshalls the object.inttoStream(OMemoryStream iStream) voidtoStream(DataOutput out) inttoStream(OutputStream iStream) toString()toString(StringBuilder iBuffer) voidunlock()UseODatabase.unlock(ORID)instead.Methods 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
-
EMPTY_RECORD_ID
-
EMPTY_RECORD_ID_STREAM
public static final byte[] EMPTY_RECORD_ID_STREAM -
PERSISTENT_SIZE
public static final int PERSISTENT_SIZE- See Also:
-
-
Constructor Details
-
ORecordId
public ORecordId() -
ORecordId
public ORecordId(int clusterId, long position) -
ORecordId
public ORecordId(int iClusterIdId) -
ORecordId
-
ORecordId
Copy constructor.- Parameters:
parentRid- Source object
-
-
Method Details
-
generateString
-
isValid
public static boolean isValid(long pos) -
isPersistent
public static boolean isPersistent(long pos) -
isNew
public static boolean isNew(long pos) -
isTemporary
public static boolean isTemporary(long clusterPosition) -
isA
-
reset
public void reset() -
isValid
public boolean isValid() -
isPersistent
public boolean isPersistent()- Specified by:
isPersistentin interfaceORID
-
isNew
public boolean isNew() -
isTemporary
public boolean isTemporary()- Specified by:
isTemporaryin interfaceORID
-
toString
-
toString
-
equals
- Specified by:
equalsin interfaceComparator<OIdentifiable>- Overrides:
equalsin classObject
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<OIdentifiable>
-
compare
- Specified by:
comparein interfaceComparator<OIdentifiable>
-
copy
-
toStream
- Throws:
IOException
-
fromStream
- Throws:
IOException
-
fromStream
- Throws:
IOException
-
fromStream
-
fromStream
Description copied from interface:OSerializableStreamUnmarshalls the object. Fills the current object with the values contained in the byte array representation restoring a previous state. Usually byte[] comes from the storage or network.- Specified by:
fromStreamin interfaceOSerializableStream- Parameters:
iBuffer- byte array representation of the object- Returns:
- The Object instance itself giving a "fluent interface". Useful to call multiple methods in chain.
-
toStream
- Specified by:
toStreamin interfaceORID- Throws:
IOException
-
toStream
- Throws:
IOException
-
toStream
public byte[] toStream()Description copied from interface:OSerializableStreamMarshalls the object. Transforms the current object in byte[] form to being stored or transferred over the network.- Specified by:
toStreamin interfaceOSerializableStream- Returns:
- The byte array representation of the object
- See Also:
-
getClusterId
public int getClusterId()- Specified by:
getClusterIdin interfaceORID
-
getClusterPosition
public long getClusterPosition()- Specified by:
getClusterPositionin interfaceORID
-
fromString
-
copyFrom
-
lock
public void lock(boolean iExclusive) Description copied from interface:OIdentifiableUseODatabase.lock(ORID)instead.- Specified by:
lockin interfaceOIdentifiable
-
isLocked
public boolean isLocked()- Specified by:
isLockedin interfaceOIdentifiable
-
lockingStrategy
- Specified by:
lockingStrategyin interfaceOIdentifiable
-
unlock
public void unlock()Description copied from interface:OIdentifiableUseODatabase.unlock(ORID)instead.- Specified by:
unlockin interfaceOIdentifiable
-
next
-
nextRid
Description copied from interface:ORIDDeprecated since v2.2 -
getIdentity
Description copied from interface:OIdentifiableReturns the record identity.- Specified by:
getIdentityin interfaceOIdentifiable- Returns:
- ORID instance
-
getRecord
Description copied from interface:OIdentifiableReturns the record instance.- Specified by:
getRecordin interfaceOIdentifiable- Returns:
- ORecord instance
-
setClusterId
public void setClusterId(int clusterId) -
setClusterPosition
public void setClusterPosition(long clusterPosition) -
serialize
- Throws:
IOException
-
deserialize
- Throws:
IOException
-