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 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 |
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 ORecordAbstract |
fill(ORID iRid,
int iVersion,
byte[] iBuffer,
boolean iDirty,
ODatabaseDocumentInternal db) |
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.
|
ODatabaseDocumentInternal |
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 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) |
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(ODatabaseDocumentInternal db) |
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, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
protected 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 ODirtyManager dirtyManager
public ORecordAbstract()
public ORecordAbstract(byte[] iSource)
public ORID getIdentity()
ORecord
getIdentity
in interface OIdentifiable
getIdentity
in interface ORecord
protected ORecordAbstract setIdentity(ORecordId iIdentity)
public ORecordElement getOwner()
getOwner
in interface ORecordElement
public ORecord getRecord()
OIdentifiable
getRecord
in interface OIdentifiable
public boolean detach()
ORecord
public ORecordAbstract clear()
ORecord
public ORecordAbstract reset()
ORecord
public byte[] toStream()
OSerializableStream
toStream
in interface OSerializableStream
OSerializableStream.fromStream(byte[])
public ORecordAbstract fromStream(byte[] iRecordBuffer)
OSerializableStream
fromStream
in interface OSerializableStream
iRecordBuffer
- byte array representation of the objectpublic ORecordAbstract setDirty()
ORecordElement
setDirty
in interface ORecordElement
public void setDirtyNoChanged()
setDirtyNoChanged
in interface ORecordElement
public boolean isDirty()
ORecord
public <RET extends ORecord> RET fromJSON(String iSource)
ORecord
public <RET extends ORecord> RET fromJSON(InputStream iContentResult) throws IOException
IOException
public String toJSON()
ORecord
public String toJSON(String iFormat)
ORecord
toJSON
in interface ORecord
iFormat
- Format settings separated by comma. Available settings are:
public void toJSON(String iFormat, OutputStream stream) throws IOException
IOException
public void toJSON(OutputStream stream) throws IOException
IOException
public int getVersion()
ORecord
getVersion
in interface ORecord
OTransactionOptimistic
protected void setVersion(int iVersion)
public ORecordAbstract unload()
ORecord
public ORecord load()
ORecord
public ODatabaseDocumentInternal getDatabase()
ORecord
getDatabase
in interface ORecord
public ODatabaseDocumentInternal getDatabaseIfDefined()
public ORecord reload()
ORecord
public ORecord reload(String fetchPlan, boolean ignoreCache, boolean force) throws ORecordNotFoundException
reload
in interface ORecord
ORecordNotFoundException
public ORecordAbstract save()
ORecord
public ORecordAbstract save(String iClusterName)
ORecord
public ORecordAbstract save(boolean forceCreate)
public ORecordAbstract save(String iClusterName, boolean forceCreate)
public ORecordAbstract delete()
ORecord
public int getSize()
ORecord
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 boolean equals(Object obj)
equals
in interface Comparator<OIdentifiable>
equals
in class Object
public 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()
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 ORecordAbstract copyTo(ORecordAbstract cloned)
protected ORecordAbstract fill(ORID iRid, int iVersion, byte[] iBuffer, boolean iDirty)
protected ORecordAbstract fill(ORID iRid, int iVersion, byte[] iBuffer, boolean iDirty, ODatabaseDocumentInternal db)
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 <RET extends ORecord> RET flatCopy()
protected void addIdentityChangeListener(OIdentityChangeListener identityChangeListener)
protected void removeIdentityChangeListener(OIdentityChangeListener identityChangeListener)
protected void setup(ODatabaseDocumentInternal db)
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–2020 OrientDB. All rights reserved.