org.unitils.dbmaintainer.structure.impl
Class DefaultConstraintsDisabler

java.lang.Object
  extended by org.unitils.dbmaintainer.util.BaseDatabaseAccessor
      extended by org.unitils.dbmaintainer.structure.impl.DefaultConstraintsDisabler
All Implemented Interfaces:
ConstraintsDisabler, DatabaseAccessing

public class DefaultConstraintsDisabler
extends BaseDatabaseAccessor
implements ConstraintsDisabler

Default implementation of ConstraintsDisabler. This will disable all foreign key, check and not-null constraints on the configured database schemas. Primary key constraints will not be disabled.

Author:
Tim Ducheyne, Filip Neven, Bart Vermeiren

Field Summary
 
Fields inherited from class org.unitils.dbmaintainer.util.BaseDatabaseAccessor
configuration, dbSupports, defaultDbSupport, sqlHandler
 
Constructor Summary
DefaultConstraintsDisabler()
           
 
Method Summary
 void disableConstraints()
          Disable every foreign key or not-null constraint
protected  void disableReferentialConstraints(DbSupport dbSupport)
          Disables all referential constraints (e.g. foreign keys) on all tables in the schema
protected  void disableValueConstraints(DbSupport dbSupport)
          Disables all value constraints (e.g. not null) on all tables in the schema
 
Methods inherited from class org.unitils.dbmaintainer.util.BaseDatabaseAccessor
doInit, getDbSupport, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.unitils.dbmaintainer.util.DatabaseAccessing
init
 

Constructor Detail

DefaultConstraintsDisabler

public DefaultConstraintsDisabler()
Method Detail

disableConstraints

public void disableConstraints()
Disable every foreign key or not-null constraint

Specified by:
disableConstraints in interface ConstraintsDisabler

disableReferentialConstraints

protected void disableReferentialConstraints(DbSupport dbSupport)
Disables all referential constraints (e.g. foreign keys) on all tables in the schema

Parameters:
dbSupport - The dbSupport for the database, not null

disableValueConstraints

protected void disableValueConstraints(DbSupport dbSupport)
Disables all value constraints (e.g. not null) on all tables in the schema

Parameters:
dbSupport - The dbSupport for the database, not null


Copyright © 2011. All Rights Reserved.