db4o

ExtObjectContainer.getID Method 

returns the internal unique object ID.

[Visual Basic]
Function getID( _ 
   ByVal obj As Object _ 
) As Long
[C#]
long getID(
   object obj
);
[C++]
__int64 getID(
   Object* obj
);
[JScript]
function getID(
   Object obj
): long;

Parameters

obj
any object

Return Value

the associated internal ID or

0
, if the passed object is not stored in this
ObjectContainer
.

Remarks

returns the internal unique object ID.

db4o assigns an internal ID to every object that is stored. IDs are guaranteed to be unique within one

ObjectContainer
. An object carries the same ID in every db4o session. Internal IDs can be used to look up objects with the very fast getByID method.

Internal IDs will change when a database is defragmented. Use com.db4o.ext.ExtObjectContainer.getObjectInfo , com.db4o.ext.ObjectInfo.getUUID and com.db4o.ext.ExtObjectContainer.getByUUID for long-term external references to objects.

See Also

ExtObjectContainer Interface | com.db4o.ext Namespace