|
db4o v1.10 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
translator interface to translate objects on storage and instantiation.
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.
Example:
Configuration config = Db4o.configure();
ObjectClass oc = config.objectClass("package.className");
oc.translate(new FooTranslator());
Method Summary | |
java.lang.Class |
forClass()
return the application Class to be converted. |
java.lang.Object |
in(ObjectContainer container,
java.lang.Object applicationObject)
db4o calls this method during storage and query evaluation. |
void |
out(ObjectContainer container,
java.lang.Object applicationObject,
java.lang.Object storedObject)
db4o calls this method during activation. |
java.lang.Class |
storedClass()
return the Class you are converting to. |
Method Detail |
public java.lang.Class forClass()
public java.lang.Object in(ObjectContainer container, java.lang.Object applicationObject)
container
- the ObjectContainer usedapplicationObject
- the Object to be translatedstoredClass()
.public void out(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 storedpublic java.lang.Class storedClass()
in()
|
db4o v1.10 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |