| com.db4o.config.ObjectTranslator
All known Subclasses: com.db4o.config.THashtable, com.db4o.config.TNull, com.db4o.config.TCollection, com.db4o.config.TVector, com.db4o.config.TMap,
ObjectTranslator | public interface ObjectTranslator (Code) | | translator interface to translate objects on storage and activation.
By writing classes that implement this interface, it is possible to
define how application classes are to be converted to be stored more efficiently.
Before starting a db4o session, translator classes need to be registered. An example:
Configuration config = Db4o.configure();
ObjectClass oc = config.objectClass("package.className");
oc.translate(new FooTranslator());
|
onActivate | public void onActivate(ObjectContainer container, Object applicationObject, Object storedObject)(Code) | | db4o calls this method during activation.
Parameters: container - the ObjectContainer used Parameters: applicationObject - the object to set the members on Parameters: storedObject - the object that was stored |
onStore | public Object onStore(ObjectContainer container, Object applicationObject)(Code) | | db4o calls this method during storage and query evaluation.
Parameters: container - the ObjectContainer used Parameters: applicationObject - the Object to be translated return the object to store. It needs to be of the classObjectTranslator.storedClass storedClass(). |
storedClass | public Class storedClass()(Code) | | return the Class you are converting to.
the Class of the object you are returning with the methodObjectTranslator.onStore onStore() |
|
|