Plugins : Store Manager

DataNucleus provides support for persisting objects to particular datastores. It provides this capability via a "Store Manager". It provides a Store Manager plugin for RDBMS datastores. You can extend DataNucleus's capabilities using the plugin extension org.datanucleus.store_manager .

Plugin extension-point Key Description Location
org.datanucleus.store_manager rdbms Store Manager for RDBMS datastores datanucleus-rdbms
org.datanucleus.store_manager db4o Store Manager for DB4O datastore datanucleus-db4o
org.datanucleus.store_manager excel Store Manager for Excel documents datanucleus-excel
org.datanucleus.store_manager ldap Store Manager for LDAP datastores datanucleus-ldap
org.datanucleus.store_manager xml Store Manager for XML datastores datanucleus-xml
org.datanucleus.store_manager neodatis Store Manager for NeoDatis datastores datanucleus-neodatis
org.datanucleus.store_manager json Store Manager for JSON datastores datanucleus-json




Interface

If you want to implement support for another datastore you can achieve it by implementating the StoreManager interface.

Plugin Specification

Once you have this implementation you then need to make the class available as a DataNucleus plugin. You do this by putting a file plugin.xml in your JAR at the root of the CLASSPATH. The file plugin.xml will look like this

<?xml version="1.0"?>
<plugin id="mydomain.mystore" name="DataNucleus plug-ins" provider-name="My Company">
    <extension point="org.datanucleus.store_manager">
        <store-manager class-name="mydomain.MyStoreManager" url-key="mykey" key="mykey"/>
    </extension>
</plugin>
Plugin Usage

The only thing remaining is to use your StoreManager. To do this you simply define your ConnectionURL to start with the mykey defined in the plugin spec. This will select your store manager based on that.