Package com.db4o.internal
Class ObjectReference
- java.lang.Object
- 
- com.db4o.internal.Identifiable
- 
- com.db4o.internal.ObjectReference
 
 
- 
- All Implemented Interfaces:
- Activator,- ObjectInfo
 
 public class ObjectReference extends Identifiable implements ObjectInfo, Activator A weak reference to an known object. "Known" ~ has been stored and/or retrieved within a transaction. References the corresponding ClassMetaData along with further metadata: internal id, UUID/version information, ...
- 
- 
Field SummaryFields Modifier and Type Field Description int_hcHashcode- 
Fields inherited from class com.db4o.internal.Identifiable_id, _state
 
- 
 - 
Constructor SummaryConstructors Constructor Description ObjectReference()ObjectReference(int id)ObjectReference(ClassMetadata classMetadata, int id)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(ActivationPurpose purpose)Method to be called to activate the host object.voidactivate(Transaction ta, java.lang.Object obj, ActivationDepth depth)voidactivateOn(Transaction transaction, ActivationPurpose purpose)ClassMetadataclassMetadata()voidclassMetadata(ClassMetadata classMetadata)ObjectContainerBasecontainer()voiddeactivate(Transaction trans, ActivationDepth depth)voidflagAsHandled(int callId)voidflagForDelete(int callId)longgetCommitTimestamp()The serial timestamp the object is assigned to when it is committed.
 
 You need to enable this feature before using it inFileConfiguration.generateCommitTimestamps(boolean).
 
 All the objects commited within the same transaction will receive the same commitTimestamp.
 
 db4o replication system (dRS) relies on this feature.bytegetIdentifier()longgetInternalID()returns the internal db4o ID.java.lang.ObjectgetObject()returns the object that is referenced.java.lang.ObjectgetObjectReference()Db4oUUIDgetUUID()returns a UUID representation of the referenced object.longgetVersion()returns the transaction serial number ("version") the referenced object was stored with last.ObjectReferencehc_add(ObjectReference newRef)HCTREEObjectReferencehc_find(java.lang.Object obj)static inthc_getCode(java.lang.Object obj)ObjectReferencehc_remove(ObjectReference findRef)voidhc_traverse(Visitor4 visitor)ObjectReferenceid_add(ObjectReference newRef)IDTREEObjectReferenceid_find(int id)ObjectReferenceid_remove(ObjectReference ref)booleanisFlaggedAsHandled(int callID)booleanisFlaggedForDelete()booleanisValid()static booleanisValidId(int id)protected booleanobjectCanUpdate(Transaction transaction, java.lang.Object obj)intownLength()VirtualAttributesproduceVirtualAttributes()java.lang.Objectread(Transaction trans, ByteArrayBuffer buffer, java.lang.Object obj, ActivationDepth instantiationDepth, int addToIDTree, boolean checkIDTree)java.lang.ObjectreadPrefetch(Transaction trans, ByteArrayBuffer buffer, int addToIDTree)voidreadThis(Transaction trans, ByteArrayBuffer buffer)voidref_init()voidsetObject(java.lang.Object obj)voidsetObjectWeak(ObjectContainerBase container, java.lang.Object obj)voidsetVirtualAttributes(VirtualAttributes at)java.lang.StringtoString()Transactiontransaction()VirtualAttributesvirtualAttributes()VirtualAttributesvirtualAttributes(Transaction trans)VirtualAttributesvirtualAttributes(Transaction trans, boolean lastCommitted)voidwriteThis(Transaction trans, ByteArrayBuffer buffer)voidwriteUpdate(Transaction transaction, UpdateDepth updatedepth)- 
Methods inherited from class com.db4o.internal.IdentifiablebeginProcessing, endProcessing, getID, hashCode, isActive, isDirty, isNew, setID, setStateClean, setStateDeactivated, setStateDirty
 
- 
 
- 
- 
- 
Constructor Detail- 
ObjectReferencepublic ObjectReference() 
 - 
ObjectReferencepublic ObjectReference(int id) 
 - 
ObjectReferencepublic ObjectReference(ClassMetadata classMetadata, int id) 
 
- 
 - 
Method Detail- 
activatepublic void activate(ActivationPurpose purpose) Description copied from interface:ActivatorMethod to be called to activate the host object.- Specified by:
- activatein interface- Activator
- Parameters:
- purpose- for which purpose is the object being activated?- ActivationPurpose.WRITEwill cause the object to be saved on the next- ObjectContainer.commit()operation.
 
 - 
activateOnpublic void activateOn(Transaction transaction, ActivationPurpose purpose) 
 - 
activatepublic void activate(Transaction ta, java.lang.Object obj, ActivationDepth depth) 
 - 
deactivatepublic void deactivate(Transaction trans, ActivationDepth depth) 
 - 
getIdentifierpublic byte getIdentifier() 
 - 
getInternalIDpublic long getInternalID() Description copied from interface:ObjectInforeturns the internal db4o ID.- Specified by:
- getInternalIDin interface- ObjectInfo
 
 - 
getObjectpublic java.lang.Object getObject() Description copied from interface:ObjectInforeturns the object that is referenced.
 This method may return null, if the object has been garbage collected.- Specified by:
- getObjectin interface- ObjectInfo
- Returns:
- the referenced object or null, if the object has been garbage collected.
 
 - 
getObjectReferencepublic java.lang.Object getObjectReference() 
 - 
containerpublic ObjectContainerBase container() 
 - 
transactionpublic Transaction transaction() 
 - 
getUUIDpublic Db4oUUID getUUID() Description copied from interface:ObjectInforeturns a UUID representation of the referenced object. UUID generation has to be turned on, in order to be able to use this feature:FileConfiguration.generateUUIDs(com.db4o.config.ConfigScope)- Specified by:
- getUUIDin interface- ObjectInfo
- Returns:
- the UUID of the referenced object.
 
 - 
getVersionpublic long getVersion() Description copied from interface:ObjectInforeturns the transaction serial number ("version") the referenced object was stored with last. Version number generation has to be turned on, in order to be able to use this feature:FileConfiguration.generateVersionNumbers(com.db4o.config.ConfigScope)
 This feature was replaced byObjectInfo.getCommitTimestamp(). The main difference is that the old version mechanism used to assign a serial timestamp to the object upon storing time, and the new commitTimestamp approach, assigns it upon commit time.- Specified by:
- getVersionin interface- ObjectInfo
- Returns:
- the version number.
 
 - 
getCommitTimestamppublic long getCommitTimestamp() Description copied from interface:ObjectInfoThe serial timestamp the object is assigned to when it is committed.
 
 You need to enable this feature before using it inFileConfiguration.generateCommitTimestamps(boolean).
 
 All the objects commited within the same transaction will receive the same commitTimestamp.
 
 db4o replication system (dRS) relies on this feature.- Specified by:
- getCommitTimestampin interface- ObjectInfo
- Returns:
- the serial timestamp that was given to the object upon commit.
- See Also:
- FileConfiguration.generateCommitTimestamps(boolean)
 
 - 
classMetadatapublic final ClassMetadata classMetadata() 
 - 
classMetadatapublic void classMetadata(ClassMetadata classMetadata) 
 - 
ownLengthpublic int ownLength() 
 - 
produceVirtualAttributespublic VirtualAttributes produceVirtualAttributes() 
 - 
readpublic final java.lang.Object read(Transaction trans, ByteArrayBuffer buffer, java.lang.Object obj, ActivationDepth instantiationDepth, int addToIDTree, boolean checkIDTree) 
 - 
readPrefetchpublic java.lang.Object readPrefetch(Transaction trans, ByteArrayBuffer buffer, int addToIDTree) 
 - 
readThispublic final void readThis(Transaction trans, ByteArrayBuffer buffer) 
 - 
setObjectWeakpublic void setObjectWeak(ObjectContainerBase container, java.lang.Object obj) 
 - 
setObjectpublic void setObject(java.lang.Object obj) 
 - 
flagForDeletepublic void flagForDelete(int callId) 
 - 
isFlaggedForDeletepublic boolean isFlaggedForDelete() 
 - 
flagAsHandledpublic void flagAsHandled(int callId) 
 - 
isFlaggedAsHandledpublic final boolean isFlaggedAsHandled(int callID) 
 - 
isValidpublic final boolean isValid() 
 - 
isValidIdpublic static final boolean isValidId(int id) 
 - 
virtualAttributespublic VirtualAttributes virtualAttributes() 
 - 
virtualAttributespublic VirtualAttributes virtualAttributes(Transaction trans, boolean lastCommitted) 
 - 
virtualAttributespublic VirtualAttributes virtualAttributes(Transaction trans) 
 - 
setVirtualAttributespublic void setVirtualAttributes(VirtualAttributes at) 
 - 
writeThispublic void writeThis(Transaction trans, ByteArrayBuffer buffer) 
 - 
writeUpdatepublic void writeUpdate(Transaction transaction, UpdateDepth updatedepth) 
 - 
objectCanUpdateprotected boolean objectCanUpdate(Transaction transaction, java.lang.Object obj) 
 - 
ref_initpublic void ref_init() 
 - 
hc_addpublic ObjectReference hc_add(ObjectReference newRef) HCTREE
 - 
hc_findpublic ObjectReference hc_find(java.lang.Object obj) 
 - 
hc_getCodepublic static int hc_getCode(java.lang.Object obj) 
 - 
hc_removepublic ObjectReference hc_remove(ObjectReference findRef) 
 - 
hc_traversepublic void hc_traverse(Visitor4 visitor) 
 - 
id_addpublic ObjectReference id_add(ObjectReference newRef) IDTREE
 - 
id_findpublic ObjectReference id_find(int id) 
 - 
id_removepublic ObjectReference id_remove(ObjectReference ref) 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-