|
db4o 2.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
extended functionality for the
ObjectContainer
interface.
Every db4o ObjectContainer
always is an ExtObjectContainer
so a cast is possible.
ObjectContainer.ext()
is a convenient method to perform the cast.
The ObjectContainer functionality is split to two interfaces to allow newcomers to
focus on the essential methods.
Method Summary | |
void |
bind(java.lang.Object obj,
long id)
binds an object to an internal object ID. |
Configuration |
configure()
returns the Configuration context
for this ObjectContainer.
|
java.lang.Object |
getByID(long ID)
returns the stored object for an internal ID. |
long |
getID(java.lang.Object obj)
returns the internal unique object ID. |
boolean |
isActive(java.lang.Object obj)
tests if an object is activated. |
boolean |
isCached(long ID)
tests if an object with this ID is currently cached. |
boolean |
isClosed()
tests if this ObjectContainer is closed.
|
boolean |
isStored(java.lang.Object obj)
tests if an object is stored in this ObjectContainer .
|
void |
purge()
unloads all clean indices from memory and frees unused objects. |
void |
purge(java.lang.Object obj)
unloads a specific object from the db4o reference mechanism. |
StoredClass |
storedClass(java.lang.String forName)
returns the stored class for a fully qualified class name. |
StoredClass[] |
storedClasses()
returns an array of all stored classes. |
Methods inherited from interface com.db4o.ObjectContainer |
activate, close, commit, deactivate, delete, ext, get, rollback, set |
Method Detail |
public void bind(java.lang.Object obj, long id)
set(Object)
is
necessary to update the stored object.getID(Object)
.object
- the object that is to be boundid
- the internal id the object is to be bound togetID(Object)
public Configuration configure()
Configuration
context
for this ObjectContainer.
Db4o class
, the global
Configuration
context
is copied into the ObjectContainer. The
Configuration
can be modified individually for
each ObjectContainer without any effects on the global settings.Configuration
the Configuration context for this ObjectContainerDb4o#configure()
public java.lang.Object getByID(long ID)
getID(Object)
.
Objects will not be activated by this method.ID
- the internal IDnull
,
if no object is associated with this ID in this ObjectContainer
.public long getID(java.lang.Object obj)
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.object
- any object0
, if the passed
object is not stored in this ObjectContainer
.public boolean isActive(java.lang.Object obj)
isActive
returns false
if an object is not
stored within the ObjectContainer
.object
- to be testedtrue
if the passed object is active.public boolean isCached(long ID)
ID
- the internal IDpublic boolean isClosed()
ObjectContainer
is closed.
true
if this ObjectContainer
is closed.public boolean isStored(java.lang.Object obj)
ObjectContainer
.
object
- to be testedtrue
if the passed object is stored.public void purge()
public void purge(java.lang.Object obj)
purge(Object)
is not "known" to the ObjectContainer
afterwards, so this method may also be used to create multiple copies of
objects.purge(Object)
has no influence on the persistence state of objects.
"Purged" objects can be reretrieved with queries.Object
- the object to be removed from the reference mechanism.public StoredClass storedClass(java.lang.String forName)
name
- the name of the class. The package name needs to be supplied.public StoredClass[] storedClasses()
|
db4o 2.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |