public class ObjectReference extends Identifiable implements ObjectInfo, Activator
| Modifier and Type | Field and Description |
|---|---|
int |
_hcHashcode |
_id, _state| Constructor and Description |
|---|
ObjectReference() |
ObjectReference(ClassMetadata classMetadata,
int id) |
ObjectReference(int id) |
| Modifier and Type | Method and Description |
|---|---|
void |
activate(ActivationPurpose purpose)
Method to be called to activate the host object.
|
void |
activate(Transaction ta,
java.lang.Object obj,
ActivationDepth depth) |
void |
activateOn(Transaction transaction,
ActivationPurpose purpose) |
ClassMetadata |
classMetadata() |
void |
classMetadata(ClassMetadata classMetadata) |
ObjectContainerBase |
container() |
void |
deactivate(Transaction trans,
ActivationDepth depth) |
void |
flagAsHandled(int callId) |
void |
flagForDelete(int callId) |
long |
getCommitTimestamp()
The serial timestamp the object is assigned to when it is commited.
You need to enable this feature before using it in FileConfiguration.generateCommitTimestamps(boolean).All the objects commited within the same transaction will receive the same commitTimestamp. db4o replication system (dRS) relies on this feature. |
byte |
getIdentifier() |
long |
getInternalID()
returns the internal db4o ID.
|
java.lang.Object |
getObject()
returns the object that is referenced.
|
java.lang.Object |
getObjectReference() |
Db4oUUID |
getUUID()
returns a UUID representation of the referenced object.
|
long |
getVersion()
returns the transaction serial number ("version") the referenced object
was stored with last.
|
ObjectReference |
hc_add(ObjectReference newRef)
HCTREE
|
ObjectReference |
hc_find(java.lang.Object obj) |
static int |
hc_getCode(java.lang.Object obj) |
ObjectReference |
hc_remove(ObjectReference findRef) |
void |
hc_traverse(Visitor4 visitor) |
ObjectReference |
id_add(ObjectReference newRef)
IDTREE
|
ObjectReference |
id_find(int id) |
ObjectReference |
id_remove(ObjectReference ref) |
boolean |
isFlaggedAsHandled(int callID) |
boolean |
isFlaggedForDelete() |
boolean |
isValid() |
static boolean |
isValidId(int id) |
protected boolean |
objectCanUpdate(Transaction transaction,
java.lang.Object obj) |
int |
ownLength() |
VirtualAttributes |
produceVirtualAttributes() |
java.lang.Object |
read(Transaction trans,
ByteArrayBuffer buffer,
java.lang.Object obj,
ActivationDepth instantiationDepth,
int addToIDTree,
boolean checkIDTree) |
java.lang.Object |
readPrefetch(Transaction trans,
ByteArrayBuffer buffer,
int addToIDTree) |
void |
readThis(Transaction trans,
ByteArrayBuffer buffer) |
void |
ref_init() |
void |
setObject(java.lang.Object obj) |
void |
setObjectWeak(ObjectContainerBase container,
java.lang.Object obj) |
void |
setVirtualAttributes(VirtualAttributes at) |
java.lang.String |
toString() |
Transaction |
transaction() |
VirtualAttributes |
virtualAttributes() |
VirtualAttributes |
virtualAttributes(Transaction trans) |
VirtualAttributes |
virtualAttributes(Transaction trans,
boolean lastCommitted) |
void |
writeThis(Transaction trans,
ByteArrayBuffer buffer) |
void |
writeUpdate(Transaction transaction,
UpdateDepth updatedepth) |
beginProcessing, endProcessing, getID, hashCode, isActive, isDirty, isNew, setID, setStateClean, setStateDeactivated, setStateDirtypublic ObjectReference()
public ObjectReference(int id)
public ObjectReference(ClassMetadata classMetadata, int id)
public void activate(ActivationPurpose purpose)
Activatoractivate in interface Activatorpurpose - for which purpose is the object being activated? ActivationPurpose.WRITE will cause the object
to be saved on the next ObjectContainer.commit() operation.public void activateOn(Transaction transaction, ActivationPurpose purpose)
public void activate(Transaction ta, java.lang.Object obj, ActivationDepth depth)
public void deactivate(Transaction trans, ActivationDepth depth)
public byte getIdentifier()
public long getInternalID()
ObjectInfogetInternalID in interface ObjectInfopublic java.lang.Object getObject()
ObjectInfogetObject in interface ObjectInfopublic java.lang.Object getObjectReference()
public ObjectContainerBase container()
public Transaction transaction()
public Db4oUUID getUUID()
ObjectInfocom.db4o.config.Configuration#generateUUIDs(int)getUUID in interface ObjectInfopublic long getVersion()
ObjectInfocom.db4o.config.Configuration#generateVersionNumbers(int) ObjectInfo.getCommitTimestamp(). The main
difference is that the old version mechamism used to assign a serial
timestamp to the object upon storing time, and the new commiTimestamp
approach, assigns it upon commit time.getVersion in interface ObjectInfopublic long getCommitTimestamp()
ObjectInfoFileConfiguration.generateCommitTimestamps(boolean).getCommitTimestamp in interface ObjectInfoFileConfiguration.generateCommitTimestamps(boolean)public final ClassMetadata classMetadata()
public void classMetadata(ClassMetadata classMetadata)
public int ownLength()
public VirtualAttributes produceVirtualAttributes()
public final java.lang.Object read(Transaction trans, ByteArrayBuffer buffer, java.lang.Object obj, ActivationDepth instantiationDepth, int addToIDTree, boolean checkIDTree)
public java.lang.Object readPrefetch(Transaction trans, ByteArrayBuffer buffer, int addToIDTree)
public final void readThis(Transaction trans, ByteArrayBuffer buffer)
public void setObjectWeak(ObjectContainerBase container, java.lang.Object obj)
public void setObject(java.lang.Object obj)
public void flagForDelete(int callId)
public boolean isFlaggedForDelete()
public void flagAsHandled(int callId)
public final boolean isFlaggedAsHandled(int callID)
public final boolean isValid()
public static final boolean isValidId(int id)
public VirtualAttributes virtualAttributes()
public VirtualAttributes virtualAttributes(Transaction trans, boolean lastCommitted)
public VirtualAttributes virtualAttributes(Transaction trans)
public void setVirtualAttributes(VirtualAttributes at)
public void writeThis(Transaction trans, ByteArrayBuffer buffer)
public void writeUpdate(Transaction transaction, UpdateDepth updatedepth)
protected boolean objectCanUpdate(Transaction transaction, java.lang.Object obj)
public void ref_init()
public ObjectReference hc_add(ObjectReference newRef)
public ObjectReference hc_find(java.lang.Object obj)
public static int hc_getCode(java.lang.Object obj)
public ObjectReference hc_remove(ObjectReference findRef)
public void hc_traverse(Visitor4 visitor)
public ObjectReference id_add(ObjectReference newRef)
public ObjectReference id_find(int id)
public ObjectReference id_remove(ObjectReference ref)
public java.lang.String toString()
toString in class java.lang.Object