palio.connectors.schema
Class AutomaticScriptFactory

java.lang.Object
  extended by palio.connectors.schema.AutomaticScriptFactory
Direct Known Subclasses:
AdsScriptFactory, BugBaseScriptFactory, CmsScriptFactory, DesignerScriptFactory, NewsletterScriptFactory, PalioConfigScriptFactory, PalioScriptFactory, SnmpScriptFactory, StandardTableFactory

public abstract class AutomaticScriptFactory
extends java.lang.Object

Author:
Szymon Kuklewicz

Field Summary
static int MAX_DECIMAL
           
static java.lang.Object NO_DEFAULT
          Put this constant as default value for clob or blob and Oracle will not set default empty_clob()/empty_blob() for you.
 
Constructor Summary
AutomaticScriptFactory()
           
 
Method Summary
 void generateCreateScript(AbstractSQLGenerator generator, SQLBatch batch, boolean utf8DB, int toVersion, ScriptGenerationConfiguration configuration)
          Generates script creating database structures to specified version
 void generateLiveUpdateScript(SQLPalioConnector connector, SQLBatch batch, boolean utf8DB, int fromVersion, int toVersion, ScriptGenerationConfiguration configuration)
          Tries to generate script updating database structure from live version to specified one if database scanning supported.
 void generateUpdateScript(AbstractSQLGenerator generator, SQLBatch batch, boolean utf8DB, int fromVersion, int toVersion, ScriptGenerationConfiguration configuration)
          Generates script updating database structures from one version to another
abstract  void insertContent(SQLConnector connector, int fromVersion)
          This method fills created tables with content.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_DECIMAL

public static final int MAX_DECIMAL
See Also:
Constant Field Values

NO_DEFAULT

public static final java.lang.Object NO_DEFAULT
Put this constant as default value for clob or blob and Oracle will not set default empty_clob()/empty_blob() for you.

Constructor Detail

AutomaticScriptFactory

public AutomaticScriptFactory()
Method Detail

insertContent

public abstract void insertContent(SQLConnector connector,
                                   int fromVersion)
                            throws palio.PalioException
This method fills created tables with content. Implementations should call insertOrUpdateIfExists methods to achieve this result.

Throws:
palio.PalioException

generateCreateScript

public void generateCreateScript(AbstractSQLGenerator generator,
                                 SQLBatch batch,
                                 boolean utf8DB,
                                 int toVersion,
                                 ScriptGenerationConfiguration configuration)
Generates script creating database structures to specified version


generateUpdateScript

public void generateUpdateScript(AbstractSQLGenerator generator,
                                 SQLBatch batch,
                                 boolean utf8DB,
                                 int fromVersion,
                                 int toVersion,
                                 ScriptGenerationConfiguration configuration)
Generates script updating database structures from one version to another


generateLiveUpdateScript

public void generateLiveUpdateScript(SQLPalioConnector connector,
                                     SQLBatch batch,
                                     boolean utf8DB,
                                     int fromVersion,
                                     int toVersion,
                                     ScriptGenerationConfiguration configuration)
                              throws palio.PalioException
Tries to generate script updating database structure from live version to specified one if database scanning supported. If not, generates script updating database structures from previously known version to specified version. If database scanning supported, script is generated using options DONT_DROP_COLUMNS (leaves old or extra

Throws:
palio.PalioException - if error occured during database scanning