DataNucleus supports persisting/retrieving objects to/from
DB4O datastores
(using the datanucleus-db4o plugin).
If you wish to contribute to this plugin either by contributing or by sponsoring particular
functionality please contact us via the
DataNucleus Forum.
DataNucleus supports 3 modes of operation of
db4o
- file-based, embedded-server-based
and client-server based.
In order to do so and to fit in with the JDO/JPA APIs we have defined the following means of
connection.
The following persistence properties will connect to a local
file-based
DB4O running
on your local machine
datanucleus.ConnectionURL=db4o:file:{my_db4o_file}
datanucleus.ConnectionUserName=
datanucleus.ConnectionPassword=
The filename {my_db4o_file} can be absolute OR relative (and not include the curly brackets!).
The following persistence properties will connect to
embedded-server-based
DB4O running
on with a local file
datanucleus.ConnectionURL=db4o:server:{my_db4o_file}
datanucleus.ConnectionUserName=
datanucleus.ConnectionPassword=
The filename {my_db4o_file} can be absolute OR relative.
The following persistence properties will connect as a client to a
TCP/IP DB4O Server
datanucleus.ConnectionURL=db4o:{db4o_host}:{db4o_port}
datanucleus.ConnectionUserName=
datanucleus.ConnectionPassword=
DB4O doesn't itself use such URLs so it was necessary to define this DataNucleus-specific
way of addressing DB4O.
So you create your PersistenceManagerFactory or
EntityManagerFactory with these properties.
Thereafter you have the full power of the JDO or JPA APIs at your disposal, for your
db4o datastore.