org.unitils.core.dbsupport
Class DbSupportFactory

java.lang.Object
  extended by org.unitils.core.dbsupport.DbSupportFactory

public class DbSupportFactory
extends Object

todo javadoc

todo cache instances


Field Summary
static String PROPKEY_DATABASE_DIALECT
          Property key of the SQL dialect of the underlying DBMS implementation
static String PROPKEY_DATABASE_SCHEMA_NAMES
          Property key for the database schema names
 
Constructor Summary
DbSupportFactory()
           
 
Method Summary
static DbSupport getDbSupport(Properties configuration, SQLHandler sqlHandler, String schemaName)
          Returns the dbms specific DbSupport as configured in the given Configuration.
static List<DbSupport> getDbSupports(Properties configuration, SQLHandler sqlHandler)
          Returns the dbms specific DbSupport instances for all configured schemas.
static DbSupport getDefaultDbSupport(Properties configuration, SQLHandler sqlHandler)
          Returns the dbms specific DbSupport as configured in the given Configuration for the default schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPKEY_DATABASE_DIALECT

public static final String PROPKEY_DATABASE_DIALECT
Property key of the SQL dialect of the underlying DBMS implementation

See Also:
Constant Field Values

PROPKEY_DATABASE_SCHEMA_NAMES

public static final String PROPKEY_DATABASE_SCHEMA_NAMES
Property key for the database schema names

See Also:
Constant Field Values
Constructor Detail

DbSupportFactory

public DbSupportFactory()
Method Detail

getDefaultDbSupport

public static DbSupport getDefaultDbSupport(Properties configuration,
                                            SQLHandler sqlHandler)
Returns the dbms specific DbSupport as configured in the given Configuration for the default schema. The default schema is the first schema in the configured list of schemas.

Parameters:
configuration - The config, not null
sqlHandler - The sql handler, not null
Returns:
The dbms specific instance of DbSupport, not null

getDbSupport

public static DbSupport getDbSupport(Properties configuration,
                                     SQLHandler sqlHandler,
                                     String schemaName)
Returns the dbms specific DbSupport as configured in the given Configuration.

Parameters:
configuration - The config, not null
sqlHandler - The sql handler, not null
schemaName - The schema name, not null
Returns:
The dbms specific instance of DbSupport, not null

getDbSupports

public static List<DbSupport> getDbSupports(Properties configuration,
                                            SQLHandler sqlHandler)
Returns the dbms specific DbSupport instances for all configured schemas.

Parameters:
configuration - The config, not null
sqlHandler - The sql handler, not null
Returns:
The dbms specific DbSupport, not null


Copyright © 2011. All Rights Reserved.