
public abstract class ORecordAbstract extends Object implements ORecord
ORecordElement.STATUS| Modifier and Type | Field and Description |
|---|---|
protected boolean |
_contentChanged |
protected boolean |
_dirty |
protected ODirtyManager |
_dirtyManager |
protected Set<ORecordListener> |
_listeners |
protected ORecordSerializer |
_recordFormat |
protected ORecordId |
_recordId |
protected int |
_recordVersion |
protected int |
_size |
protected byte[] |
_source |
protected ORecordElement.STATUS |
_status |
| Constructor and Description |
|---|
ORecordAbstract() |
ORecordAbstract(byte[] iSource) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addIdentityChangeListener(OIdentityChangeListener identityChangeListener) |
protected void |
addListener(ORecordListener iListener)
Add a listener to the current document to catch all the supported events.
|
protected void |
checkForLoading() |
ORecordAbstract |
clear()
All the fields are deleted but the record identity is maintained.
|
protected void |
clearSource() |
int |
compare(OIdentifiable iFirst,
OIdentifiable iSecond) |
int |
compareTo(OIdentifiable iOther) |
ORecordAbstract |
copyTo(ORecordAbstract cloned) |
ORecordAbstract |
delete()
Deletes the record from the database.
|
boolean |
detach()
Removes all the dependencies with other records.
|
boolean |
equals(Object obj) |
protected ORecordAbstract |
fill(ORID iRid,
int iVersion,
byte[] iBuffer,
boolean iDirty) |
protected <RET extends ORecord> |
flatCopy() |
<RET extends ORecord> |
fromJSON(InputStream iContentResult) |
<RET extends ORecord> |
fromJSON(String iSource)
Fills the record parsing the content in JSON format.
|
<RET extends ORecord> |
fromJSON(String iSource,
boolean needReload) |
<RET extends ORecord> |
fromJSON(String iSource,
String iOptions) |
ORecordAbstract |
fromStream(byte[] iRecordBuffer)
Unmarshalls the object.
|
ODatabaseDocumentInternal |
getDatabase()
Returns the database where the record belongs.
|
ODatabaseDocument |
getDatabaseIfDefined() |
protected ODatabaseDocumentInternal |
getDatabaseIfDefinedInternal() |
protected ODatabaseDocumentInternal |
getDatabaseInternal() |
protected ODirtyManager |
getDirtyManager() |
ORID |
getIdentity()
Returns the record identity as <cluster-id>:<cluster-position>
|
ORecordElement.STATUS |
getInternalStatus()
Returns the current status of the record.
|
ORecordElement |
getOwner() |
ORecord |
getRecord()
Returns the record instance.
|
protected abstract byte |
getRecordType() |
int |
getSize()
Returns the size in bytes of the record.
|
int |
getVersion()
Returns the current version number of the record.
|
int |
hashCode() |
protected void |
invokeListenerEvent(ORecordListener.EVENT iEvent) |
protected boolean |
isContentChanged() |
boolean |
isDirty()
Checks if the record is dirty, namely if it was changed in memory.
|
boolean |
isLocked() |
ORecord |
load()
Loads the record content in memory.
|
void |
lock(boolean iExclusive) |
OStorage.LOCKING_STRATEGY |
lockingStrategy() |
protected void |
onAfterIdentityChanged(ORecord iRecord) |
protected void |
onBeforeIdentityChanged(ORecord iRecord) |
ORecord |
reload()
Loads the record content in memory.
|
ORecord |
reload(String fetchPlan) |
ORecord |
reload(String fetchPlan,
boolean ignoreCache) |
ORecord |
reload(String fetchPlan,
boolean ignoreCache,
boolean force) |
protected void |
removeIdentityChangeListener(OIdentityChangeListener identityChangeListener) |
protected void |
removeListener(ORecordListener listener)
Remove the current event listener.
|
ORecordAbstract |
reset()
Resets the record to be reused.
|
ORecordAbstract |
save()
Saves in-memory changes to the database.
|
ORecordAbstract |
save(boolean forceCreate) |
ORecordAbstract |
save(String iClusterName)
Saves in-memory changes to the database defining a specific cluster where to save it.
|
ORecordAbstract |
save(String iClusterName,
boolean forceCreate) |
protected void |
setContentChanged(boolean contentChanged) |
ORecordAbstract |
setDirty()
Marks the instance as dirty.
|
protected void |
setDirtyManager(ODirtyManager dirtyManager) |
void |
setDirtyNoChanged() |
protected ORecordAbstract |
setIdentity(int iClusterId,
long iClusterPosition) |
protected ORecordAbstract |
setIdentity(ORecordId iIdentity) |
void |
setInternalStatus(ORecordElement.STATUS iStatus)
Changes the current internal status.
|
protected void |
setup() |
protected void |
setVersion(int iVersion) |
String |
toJSON()
Exports the record in JSON format.
|
void |
toJSON(OutputStream stream) |
String |
toJSON(String iFormat)
Exports the record in JSON format specifying additional formatting settings.
|
void |
toJSON(String iFormat,
OutputStream stream) |
byte[] |
toStream()
Marshalls the object.
|
String |
toString() |
protected void |
track(OIdentifiable id) |
ORecordAbstract |
unload()
Unloads current record.
|
void |
unlock() |
protected void |
unsetDirty() |
protected void |
unTrack(OIdentifiable id) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongprotected ORecordId _recordId
protected int _recordVersion
protected byte[] _source
protected int _size
protected transient ORecordSerializer _recordFormat
protected boolean _dirty
protected boolean _contentChanged
protected ORecordElement.STATUS _status
protected transient Set<ORecordListener> _listeners
protected ODirtyManager _dirtyManager
public ORecordAbstract()
public ORecordAbstract(byte[] iSource)
public ORID getIdentity()
ORecordgetIdentity in interface OIdentifiablegetIdentity in interface ORecordprotected ORecordAbstract setIdentity(ORecordId iIdentity)
public ORecordElement getOwner()
getOwner in interface ORecordElementpublic ORecord getRecord()
OIdentifiablegetRecord in interface OIdentifiablepublic boolean detach()
ORecordpublic ORecordAbstract clear()
ORecordpublic ORecordAbstract reset()
ORecordpublic byte[] toStream()
OSerializableStreamtoStream in interface OSerializableStreamOSerializableStream.fromStream(byte[])public ORecordAbstract fromStream(byte[] iRecordBuffer)
OSerializableStreamfromStream in interface OSerializableStreamiRecordBuffer - byte array representation of the objectpublic ORecordAbstract setDirty()
ORecordElementsetDirty in interface ORecordElementpublic void setDirtyNoChanged()
setDirtyNoChanged in interface ORecordElementpublic boolean isDirty()
ORecordpublic <RET extends ORecord> RET fromJSON(String iSource)
ORecordpublic <RET extends ORecord> RET fromJSON(InputStream iContentResult) throws IOException
IOExceptionpublic String toJSON()
ORecordpublic String toJSON(String iFormat)
ORecordtoJSON in interface ORecordiFormat - Format settings separated by comma. Available settings are:
public void toJSON(String iFormat, OutputStream stream) throws IOException
IOExceptionpublic void toJSON(OutputStream stream) throws IOException
IOExceptionpublic int getVersion()
ORecordgetVersion in interface ORecordOTransactionOptimisticprotected void setVersion(int iVersion)
public ORecordAbstract unload()
ORecordpublic ORecord load()
ORecordpublic ODatabaseDocumentInternal getDatabase()
ORecordgetDatabase in interface ORecordpublic ODatabaseDocument getDatabaseIfDefined()
public ORecord reload()
ORecordpublic ORecord reload(String fetchPlan, boolean ignoreCache, boolean force) throws ORecordNotFoundException
reload in interface ORecordORecordNotFoundExceptionpublic ORecordAbstract save()
ORecordpublic ORecordAbstract save(String iClusterName)
ORecordpublic ORecordAbstract save(boolean forceCreate)
public ORecordAbstract save(String iClusterName, boolean forceCreate)
public ORecordAbstract delete()
ORecordpublic int getSize()
ORecordpublic void lock(boolean iExclusive)
lock in interface OIdentifiablepublic boolean isLocked()
isLocked in interface OIdentifiablepublic OStorage.LOCKING_STRATEGY lockingStrategy()
lockingStrategy in interface OIdentifiablepublic void unlock()
unlock in interface OIdentifiablepublic boolean equals(Object obj)
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 ORecordElement.STATUS getInternalStatus()
ORecordElementgetInternalStatus in interface ORecordElementORecordElement.STATUSpublic void setInternalStatus(ORecordElement.STATUS iStatus)
ORecordElementsetInternalStatus in interface ORecordElementiStatus - status between the values defined in the enum ORecordElement.STATUSpublic ORecordAbstract copyTo(ORecordAbstract cloned)
protected ORecordAbstract fill(ORID iRid, int iVersion, byte[] iBuffer, boolean iDirty)
protected ORecordAbstract setIdentity(int iClusterId, long iClusterPosition)
protected void unsetDirty()
protected abstract byte getRecordType()
protected void onBeforeIdentityChanged(ORecord iRecord)
protected void onAfterIdentityChanged(ORecord iRecord)
protected ODatabaseDocumentInternal getDatabaseInternal()
protected ODatabaseDocumentInternal getDatabaseIfDefinedInternal()
protected void addListener(ORecordListener iListener)
iListener - ODocumentListener implementationjuprotected void removeListener(ORecordListener listener)
ORecordListenerprotected <RET extends ORecord> RET flatCopy()
protected void addIdentityChangeListener(OIdentityChangeListener identityChangeListener)
protected void removeIdentityChangeListener(OIdentityChangeListener identityChangeListener)
protected void setup()
protected void invokeListenerEvent(ORecordListener.EVENT iEvent)
protected void checkForLoading()
protected boolean isContentChanged()
protected void setContentChanged(boolean contentChanged)
protected void clearSource()
protected ODirtyManager getDirtyManager()
protected void setDirtyManager(ODirtyManager dirtyManager)
protected void track(OIdentifiable id)
protected void unTrack(OIdentifiable id)
Copyright © 2009–2025 OrientDB. All rights reserved.