Package rife.database

Class DbQueryManagerFactory

java.lang.Object
rife.database.DbQueryManagerFactory
Direct Known Subclasses:
DatabaseResourcesFactory

public abstract class DbQueryManagerFactory extends Object
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 Details

    • DbQueryManagerFactory

      public DbQueryManagerFactory()
  • Method Details

    • instance

      protected static DbQueryManager instance(String managerPackageName, DbQueryManagerCache cache, Datasource datasource)
      Get a DbQueryManager instance.
      Parameters:
      managerPackageName - the package name that corresponds to the location of the manager
      cache - the cache to be used to cache the DbQueryManagers
      datasource - the datasource to instantiate the DbQueryManager for
      Returns:
      the created DbQueryManager instance
      Since:
      1.0
    • instance

      protected static DbQueryManager instance(String managerPackageName, DbQueryManagerCache cache, Datasource datasource, String identifier)
      Get a DbQueryManager instance.
      Parameters:
      managerPackageName - the package name that corresponds to the location of the manager
      cache - the cache to be used to cache the DbQueryManagers
      datasource - the datasource to instantiate the DbQueryManager for
      identifier - the identifier to be used to uniquely identify this DbQueryManager
      Returns:
      the created DbQueryManager instance
      Since:
      1.0