|
db4o 2.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
storage and query interface.
The ObjectContainer
interface provides methods
to store, retrieve and delete objects and to commit and rollback
transactions.
Method Summary | |
void |
activate(java.lang.Object obj,
int depth)
activates all members on a stored object to the specified depth. |
boolean |
close()
closes the ObjectContainer .
|
void |
commit()
commits the running transaction. |
void |
deactivate(java.lang.Object obj,
int depth)
deactivates a stored object by setting all members to NULL .
|
void |
delete(java.lang.Object obj)
deletes a stored object permanently. |
ExtObjectContainer |
ext()
returns an ObjectContainer with extended functionality. |
ObjectSet |
get(java.lang.Object template)
Query-By-Example interface to retrieve objects. |
void |
rollback()
rolls back the running transaction. |
void |
set(java.lang.Object obj)
newly stores objects or updates stored objects. |
Method Detail |
public void activate(java.lang.Object obj, int depth)
DEACTIVATED
state are modified.
Object
members at the specified depth are
instantiated in DEACTIVATED
state.
activate()
calls on the same object have no effect.
Passing an object that is not stored in the ObjectContainer
has no effect.maximumActivationDepth()
and
minimumActivationDepth()
in the
ObjectClass
interface.activate()
triggers the callback method
objectOnActivate
which can be used for cascaded activation.Object
- the object to be activated.depth
- the member
depth
to which activate is to cascade.public boolean close()
ObjectContainer
.
close()
automatically performs a
commit()
.
while(!close()){}
to kill all sessions using this container.ObjectContainer
methods will
result in exceptions.public void commit()
public void deactivate(java.lang.Object obj, int depth)
NULL
.
ObjectContainer
.deactivate()
triggers the callback method
objectOnDeactivate
.Object
- the object to be deactivated.depth
- the member
depth
to which deactivate is to cascade.public void delete(java.lang.Object obj)
ObjectContainer
.
set()
with the same object newly stores the object
to the ObjectContainer
.delete()
triggers the callback method
objectOnDelete
which can be also used for cascaded deletes.object
- the object to be deleted from the
ObjectContainer
.ObjectClass#cascadeOnDelete
,
ObjectField#cascadeOnDelete
,
Using callbackspublic ExtObjectContainer ext()
public ObjectSet get(java.lang.Object template)
get()
creates an
ObjectSet
containing
all objects in the ObjectContainer
that match the passed
template object.get(NULL)
returns all objects stored in the
ObjectContainer
.Collection
classes are
evaluated for containment. Differences in length/size()
are
ignored.
ObjectSet
are instantiated
and activated to the preconfigured depth of 5. The
activation depth
may be configured
globally or
individually for classes.
get()
can respond to the callback
method
objectOnActivate
.template
- object to be used as an example to find all matching objects.ObjectSet
containing all found objects.public void rollback()
deactivate()
and
activate()
to reload an objects member values.public void set(java.lang.Object obj)
ObjectContainer
will be
stored when it is passed to set()
. An object already stored
in the ObjectContainer
will be updated.
set()
unless a deep
global or
class-specific
update depth was configured or cascaded updates were
defined in the class
or in
one of the member fields.
objectOnNew
or
objectOnUpdate
is triggered.
objectOnUpdate
might also be used for cascaded updates.Object
- the object to be stored or updated.Configuration#updateDepth()
,
ObjectClass#updateDepth()
,
ObjectClass#cascadeOnUpdate()
,
ObjectField#cascadeOnUpdate()
,
|
db4o 2.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |