org.unitils.dbmaintainer.util
Class BaseDatabaseAccessor

java.lang.Object
  extended by org.unitils.dbmaintainer.util.BaseDatabaseAccessor
All Implemented Interfaces:
DatabaseAccessing
Direct Known Subclasses:
DefaultConstraintsDisabler, DefaultDBCleaner, DefaultDBClearer, DefaultExecutedScriptInfoSource, DefaultScriptRunner, DefaultSequenceUpdater, DtdDataSetStructureGenerator, XsdDataSetStructureGenerator

public abstract class BaseDatabaseAccessor
extends Object
implements DatabaseAccessing

Base class for implementations that access the test database

Author:
Filip Neven, Tim Ducheyne

Field Summary
protected  Properties configuration
          The unitils configuration
protected  List<DbSupport> dbSupports
          DbSupport for all schemas
protected  DbSupport defaultDbSupport
          DbSupport for the default schema
protected  SQLHandler sqlHandler
          Provides connections to the unit test database
 
Constructor Summary
BaseDatabaseAccessor()
           
 
Method Summary
protected  void doInit(Properties configuration)
          Allows subclasses to perform some extra configuration using the given configuration.
 DbSupport getDbSupport(String schemaName)
          Gets the db support for the given schema.
 void init(Properties configuration, SQLHandler sqlHandler)
          Initializes the database operation class with the given Properties, DataSource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configuration

protected Properties configuration
The unitils configuration


sqlHandler

protected SQLHandler sqlHandler
Provides connections to the unit test database


defaultDbSupport

protected DbSupport defaultDbSupport
DbSupport for the default schema


dbSupports

protected List<DbSupport> dbSupports
DbSupport for all schemas

Constructor Detail

BaseDatabaseAccessor

public BaseDatabaseAccessor()
Method Detail

init

public void init(Properties configuration,
                 SQLHandler sqlHandler)
Initializes the database operation class with the given Properties, DataSource.

Specified by:
init in interface DatabaseAccessing
Parameters:
configuration - The configuration, not null
sqlHandler - The sql handler, not null

doInit

protected void doInit(Properties configuration)
Allows subclasses to perform some extra configuration using the given configuration.

Parameters:
configuration - The configuration, not null

getDbSupport

public DbSupport getDbSupport(String schemaName)
Gets the db support for the given schema.

Parameters:
schemaName - The schema, not null
Returns:
The db support, not null


Copyright © 2011. All Rights Reserved.