org.sandev.tools.JDBC
Class THD_ReinitConverter

java.lang.Object
  extended by org.sandev.tools.JDBC.THD_ReinitConverter
All Implemented Interfaces:
org.sandev.basics.DataManager.Converter

public class THD_ReinitConverter
extends java.lang.Object
implements org.sandev.basics.DataManager.Converter

A destructive implementation of the Converter interface that drops any bad tables and recreates them, DELETING ALL EXISTING DATA to avoid referential integrity problems. Reloading the data from an export file is attempted, but if the import fails, or if the data is not up to date, then data can be lost. Use this converter with extreme caution for anything outside of a development build. AUTOGENERATED FILE, DO NOT EDIT DIRECTLY.
source: declared in build
generator: org.sandev.generator.SQLReinitConverterGenerator
time: Jul 31, 2008 4:34:17 PM


Field Summary
protected  org.sandev.basics.DataManager.DataManagerNode dm
          Our local back reference, set during init
 
Constructor Summary
THD_ReinitConverter()
           
 
Method Summary
protected  void clearData(THD_SchemaVerifier sv)
          Delete all the data from each table.
 void fixStructure(java.lang.String tableName, java.lang.Object schemaVerifier)
          Clear all the data, then drop and recreate all the tables.
protected  void fixTable(java.lang.String tableName, THD_SchemaVerifier sv)
          Drop and recreate the specified table.
 void init(org.sandev.basics.DataManager.DataManagerNode dm)
          Initialize our DataManager back reference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dm

protected org.sandev.basics.DataManager.DataManagerNode dm
Our local back reference, set during init

Constructor Detail

THD_ReinitConverter

public THD_ReinitConverter()
Method Detail

init

public void init(org.sandev.basics.DataManager.DataManagerNode dm)
Initialize our DataManager back reference

Specified by:
init in interface org.sandev.basics.DataManager.Converter

fixStructure

public void fixStructure(java.lang.String tableName,
                         java.lang.Object schemaVerifier)
Clear all the data, then drop and recreate all the tables.

Specified by:
fixStructure in interface org.sandev.basics.DataManager.Converter

clearData

protected void clearData(THD_SchemaVerifier sv)
Delete all the data from each table. Data deletion may fail if there are referential dependencies, so to get around this keep cycling through deleting all the data in all the tables. Typically we can clear all the data in two or three passes.


fixTable

protected void fixTable(java.lang.String tableName,
                        THD_SchemaVerifier sv)
Drop and recreate the specified table.