|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Torque
Avalon role interface for Torque.
| Field Summary | |
|---|---|
static String |
ROLE
The avalon role. |
| Method Summary | ||
|---|---|---|
void |
closeConnection(Connection con)
Closes a connection. |
|
Adapter |
getAdapter(String name)
Returns database adapter for a specific connection pool. |
|
org.apache.commons.configuration.Configuration |
getConfiguration()
Get the configuration for this component. |
|
Connection |
getConnection()
This method returns a Connection from the default pool. |
|
Connection |
getConnection(String name)
|
|
Connection |
getConnection(String name,
String username,
String password)
This method returns a Connecton using the given parameters. |
|
Database |
getDatabase(String databaseName)
Returns the database for the key databaseName. |
|
DatabaseMap |
getDatabaseMap()
Returns the default database map information. |
|
DatabaseMap |
getDatabaseMap(String name)
Returns the database map information. |
|
Map<String,Database> |
getDatabases()
Returns a Map containing all Databases registered to Torque. |
|
Adapter |
getDB(String name)
Deprecated. use getAdapter(String) instead. This method will be removed in a future version of Torque. |
|
String |
getDefaultDB()
Returns the name of the default database. |
|
|
getManager(String name)
This method returns a Manager for the given name. |
|
|
getManager(String name,
String defaultClassName)
This methods returns either the Manager from the configuration file, or the default one provided by the generated code. |
|
Database |
getOrCreateDatabase(String databaseName)
Returns the database for the key databaseName. |
|
String |
getSchema(String name)
This method returns the current schema for a database connection |
|
boolean |
isInit()
Determine whether Torque has already been initialized. |
|
void |
setSchema(String name,
String schema)
Sets the current schema for a database connection |
|
| Field Detail |
|---|
static final String ROLE
| Method Detail |
|---|
boolean isInit()
org.apache.commons.configuration.Configuration getConfiguration()
<T extends AbstractBaseManager<? extends Persistent>> T getManager(String name)
name - name of the manager
<T extends AbstractBaseManager<? extends Persistent>> T getManager(String name,
String defaultClassName)
name - name of the managerdefaultClassName - the class to use if name has not been configured
DatabaseMap getDatabaseMap()
throws TorqueException
TorqueException - Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.
DatabaseMap getDatabaseMap(String name)
throws TorqueException
name - The name of the database corresponding to the
DatabaseMap to retrieve.
DatabaseMap.
TorqueException - Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.
Connection getConnection()
throws TorqueException
TorqueException - Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.
Connection getConnection(String name)
throws TorqueException
name - The database name.
TorqueException - Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.
Connection getConnection(String name,
String username,
String password)
throws TorqueException
name - The database name.username - The name of the database user.password - The password of the database user.
TorqueException - Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.
@Deprecated
Adapter getDB(String name)
throws TorqueException
name - A pool name.
TorqueException - Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.
Adapter getAdapter(String name)
throws TorqueException
name - A pool name.
TorqueException - Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.String getDefaultDB()
void closeConnection(Connection con)
con - A Connection to close.
void setSchema(String name,
String schema)
throws TorqueException
name - The database name.schema - The current schema name
TorqueException - Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.
String getSchema(String name)
throws TorqueException
name - The database name.
TorqueException - Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.
Database getDatabase(String databaseName)
throws TorqueException
databaseName.
databaseName - the key to get the database for.
TorqueException - if Torque is not yet initialized.
Map<String,Database> getDatabases()
throws TorqueException
TorqueException - if Torque is not yet initialized.Database getOrCreateDatabase(String databaseName)
databaseName.
If no database is associated to the specified key,
a new database is created, mapped to the specified key, and returned.
databaseName - the key to get the database for.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||