Package rife.database
Class DbQueryManagerFactory
java.lang.Object
rife.database.DbQueryManagerFactory
- Direct Known Subclasses:
DatabaseContentFactory
,DatabaseImageStoreFactory
,DatabaseRawStoreFactory
,DatabaseRememberFactory
,DatabaseResourcesFactory
,DatabaseSchedulingFactory
,DatabaseSessionsFactory
,DatabaseSessionValidatorFactory
,DatabaseTaskOptionsFactory
,DatabaseTasksFactory
,DatabaseTextStoreFactory
,DatabaseUsersFactory
This class allows for
DbQueryManager
s 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
-
Method Summary
Modifier and TypeMethodDescriptionprotected static DbQueryManager
instance
(String managerPackageName, DbQueryManagerCache cache, Datasource datasource) Get aDbQueryManager
instance.protected static DbQueryManager
instance
(String managerPackageName, DbQueryManagerCache cache, Datasource datasource, String identifier) Get aDbQueryManager
instance.
-
Constructor Details
-
DbQueryManagerFactory
public DbQueryManagerFactory()
-
-
Method Details
-
instance
protected static DbQueryManager instance(String managerPackageName, DbQueryManagerCache cache, Datasource datasource) Get aDbQueryManager
instance.- Parameters:
managerPackageName
- the package name that corresponds to the location of the managercache
- the cache to be used to cache theDbQueryManager
sdatasource
- the datasource to instantiate theDbQueryManager
for- Returns:
- the created
DbQueryManager
instance - Since:
- 1.0
-
instance
protected static DbQueryManager instance(String managerPackageName, DbQueryManagerCache cache, Datasource datasource, String identifier) Get aDbQueryManager
instance.- Parameters:
managerPackageName
- the package name that corresponds to the location of the managercache
- the cache to be used to cache theDbQueryManager
sdatasource
- the datasource to instantiate theDbQueryManager
foridentifier
- the identifier to be used to uniquely identify thisDbQueryManager
- Returns:
- the created
DbQueryManager
instance - Since:
- 1.0
-