db4o 2.0

com.db4o.ext
Interface ObjectCallbacks


public interface ObjectCallbacks

callback methods.

Examples: ../com/db4o/samples/callbacks.

This interface only serves as a lists of all available callback methods. Every method is called individually, independant of implementing this interface.

Using callbacks
Simply implement one or more of the listed methods in your application classes to respond to activation, deactivation, delete, new or update.

Callback methods are typically used for:
- cascaded delete
- cascaded update
- cascaded activation
- restoring transient members on instantiation

Callback methods follow the regular Java calling conventions. Methods in superclasses need to be called explicitely.

All method calls are implemented to occur only once, upon one event.


Method Summary
 void objectOnActivate(ObjectContainer container)
          called upon activation of an object.
 void objectOnDeactivate(ObjectContainer container)
          called upon deactivation of an object.
 void objectOnDelete(ObjectContainer container)
          called after an object was deleted.
 void objectOnNew(ObjectContainer container)
          called after a new object was stored.
 void objectOnUpdate(ObjectContainer container)
          called after an object was updated.
 

Method Detail

objectOnActivate

public void objectOnActivate(ObjectContainer container)
called upon activation of an object.
Parameters:
container - the ObjectContainer the object is stored in.
See Also:
ObjectClass#cascadeOnActivate(), Why activation?

objectOnDeactivate

public void objectOnDeactivate(ObjectContainer container)
called upon deactivation of an object.
Parameters:
container - the ObjectContainer the object is stored in.

objectOnDelete

public void objectOnDelete(ObjectContainer container)
called after an object was deleted.
Parameters:
container - the ObjectContainer the object was stored in.
See Also:
ObjectClass#cascadeOnDelete()

objectOnNew

public void objectOnNew(ObjectContainer container)
called after a new object was stored.
Parameters:
container - the ObjectContainer the object is stored to.

objectOnUpdate

public void objectOnUpdate(ObjectContainer container)
called after an object was updated.
Parameters:
container - the ObjectContainer the object is stored in.
See Also:
ObjectClass#cascadeOnUpdate()

db4o 2.0