public final class JDOConfFactory
extends java.lang.Object
This is an example for setting up a JDO configuration using JDOConfFactory:
// create driver configuration
org.castor.jdo.conf.Driver driverConf =
JDOConfFactory.createDriver(DRIVER, CONNECT, USERNAME, PASSWORD);
// create mapping configuration
String mappingConf = getClass().getResource(MAPPING).toString();
// create database configuration
org.castor.jdo.conf.Database dbConf =
JDOConfFactory.createDatabase(DATABASE, ENGINE, driverConf, mappingConf);
// create and load jdo configuration
JDOManager.loadConfiguration(JDOConfFactory.createJdoConf(dbConf), null);
Modifier and Type | Method | Description |
---|---|---|
static ClassMapping |
createClassMapping(java.lang.String classname) |
Create an class mapping configurations for JDO from given class name.
|
static Database |
createDatabase(java.lang.String name,
java.lang.String engine,
DataSource ds) |
Create a database configuration with given name, engine and datasource
configuration.
|
static Database |
createDatabase(java.lang.String name,
java.lang.String engine,
DataSource ds,
java.lang.String mapping) |
Deprecated.
create database w/o mapping.
|
static Database |
createDatabase(java.lang.String name,
java.lang.String engine,
DataSource ds,
java.lang.String[] mappings) |
Deprecated.
create database w/o mappings.
|
static Database |
createDatabase(java.lang.String name,
java.lang.String engine,
Driver driver) |
Create a database configuration with given name, engine and driver
configuration.
|
static Database |
createDatabase(java.lang.String name,
java.lang.String engine,
Driver driver,
java.lang.String mapping) |
Deprecated.
create database w/o mapping.
|
static Database |
createDatabase(java.lang.String name,
java.lang.String engine,
Driver driver,
java.lang.String[] mappings) |
Deprecated.
create database w/o mappings.
|
static Database |
createDatabase(java.lang.String name,
java.lang.String engine,
Jndi jndi) |
Create a database configuration with given name, engine and JNDI
configuration.
|
static Database |
createDatabase(java.lang.String name,
java.lang.String engine,
Jndi jndi,
java.lang.String mapping) |
Deprecated.
create database w/o mapping.
|
static Database |
createDatabase(java.lang.String name,
java.lang.String engine,
Jndi jndi,
java.lang.String[] mappings) |
Deprecated.
create database w/o mappings.
|
static DataSource |
createDataSource(java.lang.String datasource,
java.util.Properties props) |
Create a JDO datasource configuration from a JDBC DataSource instance
and apply the supplied property entries.
|
static Driver |
createDriver(java.lang.String driver,
java.lang.String connect,
java.lang.String user,
java.lang.String password) |
Create a JDO driver configuration from JDBC connection parameters.
|
static TransactionDemarcation |
createGlobalTransactionDemarcation(java.lang.String name,
java.util.Properties props) |
Create a transaction demarcation configuration with global transaction handling
for transaction manager with given name using given properties.
|
static JdoConf |
createJdoConf(Database database) |
Create a JDO configuration with local transaction demarcation and given database.
|
static JdoConf |
createJdoConf(Database[] databases) |
Create a JDO configuration with local transaction demarcation and given databases.
|
static JdoConf |
createJdoConf(Database[] databases,
TransactionDemarcation tx) |
Create a JDO configuration with given databases and transaction demarcation.
|
static JdoConf |
createJdoConf(Database database,
TransactionDemarcation tx) |
Create a JDO configuration with given database and transaction demarcation.
|
static JdoConf |
createJdoConf(org.xml.sax.InputSource source,
org.xml.sax.EntityResolver resolver,
java.lang.ClassLoader loader) |
Creates a JdoConf instance from a SAX InputSource, using a Castor XML
Unmarshaller.
|
static Jndi |
createJNDI(java.lang.String name) |
Create a JDO jndi configuration with the given name.
|
static TransactionDemarcation |
createLocalTransactionDemarcation() |
Create a transaction demarcation configuration with local transaction handling.
|
static PackageMapping |
createPackageMapping(java.lang.String packagename) |
Create an package mapping configurations for JDO from given package name.
|
static Mapping |
createXmlMapping(java.lang.String mapping) |
Create an XML mapping configurations for JDO from given URL.
|
public static JdoConf createJdoConf(org.xml.sax.InputSource source, org.xml.sax.EntityResolver resolver, java.lang.ClassLoader loader) throws MappingException
source
- SAX input source representing the JDO configuration.resolver
- SAX entity resolver.loader
- Class loader.MappingException
- If failed to load the mconfiguration from source.public static JdoConf createJdoConf(Database database)
database
- Database configuration.public static JdoConf createJdoConf(Database[] databases)
databases
- Array of database configurations.public static JdoConf createJdoConf(Database database, TransactionDemarcation tx)
database
- Database configuration.tx
- TransactionDemarcation configuration.public static JdoConf createJdoConf(Database[] databases, TransactionDemarcation tx)
databases
- Array of database configurations.tx
- TransactionDemarcation configuration.public static Database createDatabase(java.lang.String name, java.lang.String engine, DataSource ds, java.lang.String mapping)
name
- Name of the database configuration.engine
- Name of the database engine.ds
- Datasource configuration.mapping
- Mapping URL.public static Database createDatabase(java.lang.String name, java.lang.String engine, DataSource ds, java.lang.String[] mappings)
name
- Name of the database configuration.engine
- Name of the database engine.ds
- Datasource configuration.mappings
- Array of mapping URL's.public static Database createDatabase(java.lang.String name, java.lang.String engine, DataSource ds)
name
- Name of the database configuration.engine
- Name of the database engine.ds
- Datasource configuration.public static Database createDatabase(java.lang.String name, java.lang.String engine, Driver driver, java.lang.String mapping)
name
- Name of the database configuration.engine
- Name of the database engine.driver
- Driver configuration.mapping
- Mapping URL.public static Database createDatabase(java.lang.String name, java.lang.String engine, Driver driver, java.lang.String[] mappings)
name
- Name of the database configuration.engine
- Name of the database engine.driver
- Driver configuration.mappings
- Array of mapping URL's.public static Database createDatabase(java.lang.String name, java.lang.String engine, Driver driver)
name
- Name of the database configuration.engine
- Name of the database engine.driver
- Driver configuration.public static Database createDatabase(java.lang.String name, java.lang.String engine, Jndi jndi, java.lang.String mapping)
name
- Name of the database configuration.engine
- Name of the database engine.jndi
- JNDI configuration.mapping
- Mapping URL.public static Database createDatabase(java.lang.String name, java.lang.String engine, Jndi jndi, java.lang.String[] mappings)
name
- Name of the database configuration.engine
- Name of the database engine.jndi
- JNDI configuration.mappings
- Array of mapping URL's.public static Database createDatabase(java.lang.String name, java.lang.String engine, Jndi jndi)
name
- Name of the database configuration.engine
- Name of the database engine.jndi
- JNDI configuration.public static Driver createDriver(java.lang.String driver, java.lang.String connect, java.lang.String user, java.lang.String password)
driver
- JDBC driver name.connect
- JDBC connect string.user
- User name for the DB login.password
- Password for the DB login.public static DataSource createDataSource(java.lang.String datasource, java.util.Properties props)
datasource
- JDBC DataSource class name.props
- Properties to be used for the DataSource.public static Jndi createJNDI(java.lang.String name)
name
- Name to lookup JDBC Datasource through JNDI.public static Mapping createXmlMapping(java.lang.String mapping)
mapping
- URL to retrieve mapping configuration file.public static ClassMapping createClassMapping(java.lang.String classname)
classname
- Class name to retrieve mapping information.public static PackageMapping createPackageMapping(java.lang.String packagename)
packagename
- Package name to retrieve mapping information.public static TransactionDemarcation createLocalTransactionDemarcation()
public static TransactionDemarcation createGlobalTransactionDemarcation(java.lang.String name, java.util.Properties props)
name
- Name of the transaction manager.props
- Properties to be used for the transaction manager.Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com