public class DatastoreAdapterFactory extends Object
org.datanucleus.store.rdbms.datastoreadapter
extension point. These extension can define a priority, so if multiple adapter match for the
given database connection the one with the highest priority is chosen.
getDatastoreAdapter(ClassLoaderResolver, Connection, String, PluginManager)
passing the adapter class name directly if you know which you want to use. This allows for
user-defined database adapters.Modifier | Constructor and Description |
---|---|
protected |
DatastoreAdapterFactory()
Protected constructor to prevent outside instantiation
|
Modifier and Type | Method and Description |
---|---|
protected Class |
getAdapterClass(org.datanucleus.plugin.PluginManager pluginMgr,
String adapterClassName,
String productName,
org.datanucleus.ClassLoaderResolver clr)
Accessor for the adapter class for a specified datastore product.
|
DatastoreAdapter |
getDatastoreAdapter(org.datanucleus.ClassLoaderResolver clr,
Connection conn,
String adapterClassName,
org.datanucleus.plugin.PluginManager pluginMgr)
Accessor for an adapter, given a Connection to the datastore.
|
static DatastoreAdapterFactory |
getInstance()
Accessor for the RDBMSAdapterFactory.
|
protected DatastoreAdapter |
getNewDatastoreAdapter(org.datanucleus.ClassLoaderResolver clr,
DatabaseMetaData metadata,
String adapterClassName,
org.datanucleus.plugin.PluginManager pluginMgr)
Accessor for the adapter for a specified datastore product.
|
protected DatastoreAdapterFactory()
public static DatastoreAdapterFactory getInstance()
public DatastoreAdapter getDatastoreAdapter(org.datanucleus.ClassLoaderResolver clr, Connection conn, String adapterClassName, org.datanucleus.plugin.PluginManager pluginMgr) throws SQLException
clr
- ClassLoader resolver for resolving the adapter classconn
- The ConnectionadapterClassName
- Name of the class of the database adapter to usepluginMgr
- the Plug-in managerSQLException
- Thrown if a DB error occurs.protected DatastoreAdapter getNewDatastoreAdapter(org.datanucleus.ClassLoaderResolver clr, DatabaseMetaData metadata, String adapterClassName, org.datanucleus.plugin.PluginManager pluginMgr)
clr
- ClassLoader resolver for resolving the adapter classmetadata
- Database MetaData for the RDBMSadapterClassName
- Name of the class of the database adapter (null implies use autodetect)pluginMgr
- the Plug-in managerprotected Class getAdapterClass(org.datanucleus.plugin.PluginManager pluginMgr, String adapterClassName, String productName, org.datanucleus.ClassLoaderResolver clr)
pluginMgr
- the Plug-in manageradapterClassName
- Name of the class of the database adapter (null implies use autodetect)productName
- the database product nameclr
- ClassLoader resolver for resolving the adapter classCopyright © 2015. All rights reserved.