| java.lang.Object org.apache.torque.Database
Database | public class Database (Code) | | Bundles all information about a database. This includes the database adapter,
the database Map and the Data Source Factory.
|
Constructor Summary | |
| Database(String aName) Creates a new Database with the given name. |
Database | Database(String aName)(Code) | | Creates a new Database with the given name.
Parameters: aName - the name of the database, not null. |
addIdGenerator | public void addIdGenerator(String type, IdGenerator idGen)(Code) | | Adds an IdGenerator to the database.
Parameters: type - The type of the IdGenerator Parameters: idGen - The new IdGenerator for the type, or nullto remove the IdGenerator of the given type. |
getAdapter | public DB getAdapter()(Code) | | Returns the adapther to this database.
the adapter to this database, or null if no adapter is set. |
getDataSourceFactory | public DataSourceFactory getDataSourceFactory()(Code) | | Returns the DataSourceFactory for this database.
The DataSourceFactory is responsible to create connections
to this database.
the DataSourceFactory for this database, or null if noDataSourceFactory exists for this database. |
getDatabaseMap | public synchronized DatabaseMap getDatabaseMap()(Code) | | Returns the database map for this database.
If the database map does not exist yet, it is created by this method.
|
getIDBroker | public IDBroker getIDBroker()(Code) | | Get the IDBroker for this database.
The IDBroker for this database, or null if no IdBroker hasbeen started for this database. |
getIdGenerator | public IdGenerator getIdGenerator(String type)(Code) | | Returns the IdGenerator of the given type for this Database.
Parameters: type - The type (i.e.name) of the IdGenerator The IdGenerator of the requested type, or null if no IdGeneratorexists for the requested type. |
getName | public String getName()(Code) | | returns the name of the database.
the name of the database. May be null. |
getSchema | public String getSchema()(Code) | | Returns the database schema for this Database.
the database schema for this database, or null if no schemahas been set. |
setAdapter | public void setAdapter(DB anAdapter)(Code) | | Sets the adapter for this database.
Parameters: anAdapter - The adapter for this database, or null to remove thecurrent adapter from this database. |
setDataSourceFactory | public void setDataSourceFactory(DataSourceFactory aDataSourceFactory)(Code) | | Sets the DataSourceFactory for this database.
The DataSourceFactory is responsible to create connections
to this database.
Parameters: aDataSourceFactory - The new DataSorceFactory for this database,or null to remove the current DataSourceFactory. |
setSchema | public void setSchema(String schema)(Code) | | Sets the schema for this database.
Parameters: schema - the name of the database schema to set, or null to removethe current schema. throws: NullPointerException - if no DatasourceFactory exists for thisdatabase. |
startIDBroker | public synchronized boolean startIDBroker()(Code) | | Creates the IDBroker for this DatabaseMap and starts it for the
given database.
The information about the IdTable is stored in the databaseMap.
If an IDBroker already exists for the DatabaseMap, the method
does nothing.
true if a new IDBroker was created, false otherwise. |
|
|