|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) public @interface Db4Objects
Use this annotation as a binding point for Db4o configuration. And its constants (HOST, PORT, etc.)
to bind specific values for those items when configuring for an ObjectServer
. Example:
bindConstant().annotatedWith(Db4Objects.class).to("TestDatabase.data");
bindConstant().annotatedWith(Names.named(Db4Objects.HOST)).to("localhost");
bindConstant().annotatedWith(Names.named(Db4Objects.PORT)).to(4321);
bindConstant().annotatedWith(Names.named(Db4Objects.USER)).to("autobot");
bindConstant().annotatedWith(Names.named(Db4Objects.PASSWORD)).to("morethanmeetstheeye");
Configuration config = Db4o.newConfiguration();
bind(Configuration.class).toInstance(config);
You may also use the simple alternative (single file object server), for local file dbs:
bindConstant().annotatedWith(Db4Objects.class).to("TestDatabase.data");
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |