# 16. Callbacks

Callback methods are automatically called on persistent objects by db4o during certain database events.
For a complete list of the signatures of all available methods see the com.db4o.ext.ObjectCallbacks interface.
You do not have to implement this interface. db4o recognizes the presence of individual methods by their signature, using reflection. You can simply add one or more of the methods to your persistent classes and they will be called.
Returning false to the #objectCanXxxx() methods will prevent the current action from being taken.
In a client/server environment callback methods will be called on the client with two exceptions:
objectOnDelete(), objectCanDelete()
Some possible usecases for callback methods:
- setting default values after refactorings
- checking object integrity before storing objects
- setting transient fields
- restoring connected state (of GUI, files, connections)
- cascading activation
- cascading updates
- creating special indexes
--
generated by Doctor courtesy of db4objects Inc.