Package org.castor.jdo.engine
Class DatabaseContext
java.lang.Object
org.castor.jdo.engine.DatabaseContext
- Since:
- 0.9.9
- Version:
- $Revision: 8702 $ $Date: 2006-04-10 16:39:24 -0600 (Mon, 10 Apr 2006) $
- Author:
- Werner Guttmann, Ralf Joachim
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The name of the generic SQL engine, if no SQL engine specified. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DatabaseContext
(String name, String engine, Mapping mapping, 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. -
Method Summary
Modifier and TypeMethodDescriptionDatabase
Get the database configuration.Get the LockEngine only available after initialization.Get the mapping to load.getName()
Get the name of the database configuration.Get the transaction manager.void
Initialize factory if it had not been initialized before.void
void
setClassDescriptorResolver
(JDOClassDescriptorResolver classDescriptorResolver) Sets a custominvalid reference
ClassDescriptorResolver
-
Field Details
-
GENERIC_ENGINE
The name of the generic SQL engine, if no SQL engine specified.- See Also:
-
-
Constructor Details
-
DatabaseContext
protected DatabaseContext(String name, String engine, Mapping mapping, TransactionManager txManager, ConnectionFactory factory) throws MappingException Constructs a new AbstractConnectionFactory with given name, engine and mapping. Factory will be ready to use without calling initialize first.- Parameters:
name
- The Name of the database configuration.engine
- The Name of the persistence factory to use.mapping
- The previously loaded mapping.txManager
- The transaction manager to use.- Throws:
MappingException
- If LockEngine could not be initialized.
-
DatabaseContext
Constructs a new AbstractConnectionFactory with given database and mapping. Initialize needs to be called before using the factory to create connections.- Parameters:
jdoConf
- The JDO configuration.index
- Index of the database configuration in the JDO configuration.mapping
- The mapping to load.
-
-
Method Details
-
initialize
Initialize factory if it had not been initialized before.- Throws:
MappingException
- If concrete factory or LockEngine fail to initialize or mapping could not be loaded.
-
initializeFactory
- Throws:
MappingException
-
getConnectionFactory
-
getName
Get the name of the database configuration.- Returns:
- The name of the database configuration.
-
getDatabase
public Database getDatabase()Get the database configuration.- Returns:
- The database configuration.
-
getMapping
Get the mapping to load.- Returns:
- The mapping to load.
-
getTransactionManager
Get the transaction manager.- Returns:
- The transaction manager.
-
getEngine
Get the LockEngine only available after initialization.- Returns:
- The LockEngine.
-
setClassDescriptorResolver
Sets a custominvalid reference
ClassDescriptorResolver
- Parameters:
classDescriptorResolver
- A custominvalid reference
ClassDescriptorResolver
-