public final class DatabaseContext
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
GENERIC_ENGINE |
The name of the generic SQL engine, if no SQL engine specified.
|
Modifier | Constructor | Description |
---|---|---|
protected |
DatabaseContext(java.lang.String name,
java.lang.String engine,
Mapping mapping,
javax.transaction.TransactionManager txManager,
ConnectionFactory factory) |
Constructs a new AbstractConnectionFactory with given name, engine and mapping.
|
protected |
DatabaseContext(JdoConf jdoConf,
int index,
Mapping mapping,
ConnectionFactory factory) |
Constructs a new AbstractConnectionFactory with given database and mapping.
|
Modifier and Type | Method | Description |
---|---|---|
ConnectionFactory |
getConnectionFactory() |
|
Database |
getDatabase() |
Get the database configuration.
|
LockEngine |
getEngine() |
Get the LockEngine only available after initialization.
|
Mapping |
getMapping() |
Get the mapping to load.
|
java.lang.String |
getName() |
Get the name of the database configuration.
|
javax.transaction.TransactionManager |
getTransactionManager() |
Get the transaction manager.
|
void |
initialize() |
Initialize factory if it had not been initialized before.
|
void |
initializeFactory() |
|
void |
setClassDescriptorResolver(JDOClassDescriptorResolver classDescriptorResolver) |
Sets a custom
ClassDescriptorResolver instance. |
public static final java.lang.String GENERIC_ENGINE
protected DatabaseContext(java.lang.String name, java.lang.String engine, Mapping mapping, javax.transaction.TransactionManager txManager, ConnectionFactory factory) throws MappingException
name
- The Name of the database configuration.engine
- The Name of the persistence factory to use.txManager
- The transaction manager to use.mapping
- The previously loaded mapping.MappingException
- If LockEngine could not be initialized.protected DatabaseContext(JdoConf jdoConf, int index, Mapping mapping, ConnectionFactory factory)
jdoConf
- The JDO configuration.index
- Index of the database configuration in the JDO configuration.mapping
- The mapping to load.public void initialize() throws MappingException
MappingException
- If concrete factory or LockEngine fail to initialize
or mapping could not be loaded.public void initializeFactory() throws MappingException
MappingException
public ConnectionFactory getConnectionFactory()
public java.lang.String getName()
public Database getDatabase()
public Mapping getMapping()
public javax.transaction.TransactionManager getTransactionManager()
public LockEngine getEngine()
public void setClassDescriptorResolver(JDOClassDescriptorResolver classDescriptorResolver)
ClassDescriptorResolver
instance.classDescriptorResolver
- A custom ClassDescriptorResolver
instance to be used.Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com