Package rife.database
Class DbQueryManagerFactory
java.lang.Object
rife.database.DbQueryManagerFactory
- Direct Known Subclasses:
DatabaseResourcesFactory
This class allows for
DbQueryManagers to be created more
dynamically and with more features than by direct instantiation.
By using the DbQueryManagerFactory,
DbQueryManager child classes can have custom methods that are
implemented by different "drivers", based on the database software behind
the Datasource. Database "drivers" are looked up through the
manager's classpath according to the package name and the encoded class
name of the JDBC driver (dots are replaced by underscores). The default, or
"generic" driver, must be created under this package and will be used when
no specific driver can be found for a particular Datasource.
All the created DbQueryManagers are cached in the provided cache and are
re-used on successive calls rather than being re-instantiated.
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static DbQueryManagerinstance(String managerPackageName, DbQueryManagerCache cache, Datasource datasource) Get aDbQueryManagerinstance.protected static DbQueryManagerinstance(String managerPackageName, DbQueryManagerCache cache, Datasource datasource, String identifier) Get aDbQueryManagerinstance.
-
Constructor Details
-
DbQueryManagerFactory
public DbQueryManagerFactory()
-
-
Method Details
-
instance
protected static DbQueryManager instance(String managerPackageName, DbQueryManagerCache cache, Datasource datasource) Get aDbQueryManagerinstance.- Parameters:
managerPackageName- the package name that corresponds to the location of the managercache- the cache to be used to cache theDbQueryManagersdatasource- the datasource to instantiate theDbQueryManagerfor- Returns:
- the created
DbQueryManagerinstance - Since:
- 1.0
-
instance
protected static DbQueryManager instance(String managerPackageName, DbQueryManagerCache cache, Datasource datasource, String identifier) Get aDbQueryManagerinstance.- Parameters:
managerPackageName- the package name that corresponds to the location of the managercache- the cache to be used to cache theDbQueryManagersdatasource- the datasource to instantiate theDbQueryManagerforidentifier- the identifier to be used to uniquely identify thisDbQueryManager- Returns:
- the created
DbQueryManagerinstance - Since:
- 1.0
-