|
db4o 6.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ObjectTranslator
translator interface to translate objects on storage and activation.
Examples: ../com/db4o/samples/translators.
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());
Method Summary | |
---|---|
void |
onActivate(ObjectContainer container,
java.lang.Object applicationObject,
java.lang.Object storedObject)
db4o calls this method during activation. |
java.lang.Object |
onStore(ObjectContainer container,
java.lang.Object applicationObject)
db4o calls this method during storage and query evaluation. |
java.lang.Class |
storedClass()
return the Class you are converting to. |
Method Detail |
---|
java.lang.Object onStore(ObjectContainer container, java.lang.Object applicationObject)
container
- the ObjectContainer usedapplicationObject
- the Object to be translated
storedClass()
.void onActivate(ObjectContainer container, java.lang.Object applicationObject, java.lang.Object storedObject)
container
- the ObjectContainer usedapplicationObject
- the object to set the members onstoredObject
- the object that was storedjava.lang.Class storedClass()
onStore()
|
db4o 6.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |