palio.connectors.schema.generators
Class MSSQL2kGenerator

java.lang.Object
  extended by palio.connectors.schema.generators.AbstractSQLGenerator
      extended by palio.connectors.schema.generators.MSSQL2kGenerator

public class MSSQL2kGenerator
extends AbstractSQLGenerator

Author:
Szymon Kuklewicz

Constructor Summary
MSSQL2kGenerator()
           
 
Method Summary
 void alterTableAddColumn(SQLBatch sqls, java.lang.String table, java.lang.String column, TableColumnDataType dataType, java.lang.Object defaultValue, boolean notNull)
           
 void alterTableAddKey(SQLBatch sqls, java.lang.String table, ConstraintType constraintType, java.lang.String constraintName, java.lang.String columns, java.lang.String additional)
           
 void alterTableAlterColumn(SQLBatch sqls, java.lang.String table, java.lang.String column, TableColumnDataType dataType, java.lang.Object defaultValue, boolean changeNotNull, boolean shouldBeNotNull)
          Parameter notNull may be null if state of "not null constraint" is not to be changed
 void alterTableDropKey(SQLBatch sqls, java.lang.String table, ConstraintType constraintType, java.lang.String constraintName)
           
 void alterTableSetNotNull(SQLBatch sqls, java.lang.String table, java.lang.String column, TableColumnDataType currentDataType, java.lang.Object currentDefaultValue, boolean notNull)
          MSSQL does not support only not null constraint change
 boolean areConstraintsViolateColumnDataTypeChange()
          Note!
 void createSequence(SQLBatch sqls, java.lang.String name)
           
 void createTable(SQLBatch sqls, Table table)
           
 void dropSequence(SQLBatch sqls, java.lang.String sequenceToDrop)
           
 void dropTable(SQLBatch sqls, java.lang.String tableToDrop)
           
 DatabaseSchema scanDatabase(SQLConnector connector, SQLScannerFilter filter)
           
 
Methods inherited from class palio.connectors.schema.generators.AbstractSQLGenerator
alterTableAddForeignKey, alterTableAddPrimaryKey, alterTableAddUniqueKey, alterTableDropColumn, alterTableDropForeignKey, alterTableDropPrimaryKey, alterTableDropUniqueKey, createIndex, dropIndex
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MSSQL2kGenerator

public MSSQL2kGenerator()
Method Detail

areConstraintsViolateColumnDataTypeChange

public boolean areConstraintsViolateColumnDataTypeChange()
Description copied from class: AbstractSQLGenerator
Note! Implementations should not create indexes for foreign keys as there are automatically created outside createTable routime.

Overrides:
areConstraintsViolateColumnDataTypeChange in class AbstractSQLGenerator

createTable

public void createTable(SQLBatch sqls,
                        Table table)
Specified by:
createTable in class AbstractSQLGenerator

createSequence

public void createSequence(SQLBatch sqls,
                           java.lang.String name)
Specified by:
createSequence in class AbstractSQLGenerator

alterTableAddKey

public void alterTableAddKey(SQLBatch sqls,
                             java.lang.String table,
                             ConstraintType constraintType,
                             java.lang.String constraintName,
                             java.lang.String columns,
                             java.lang.String additional)
Specified by:
alterTableAddKey in class AbstractSQLGenerator

alterTableDropKey

public void alterTableDropKey(SQLBatch sqls,
                              java.lang.String table,
                              ConstraintType constraintType,
                              java.lang.String constraintName)
Specified by:
alterTableDropKey in class AbstractSQLGenerator

alterTableAddColumn

public void alterTableAddColumn(SQLBatch sqls,
                                java.lang.String table,
                                java.lang.String column,
                                TableColumnDataType dataType,
                                java.lang.Object defaultValue,
                                boolean notNull)
Specified by:
alterTableAddColumn in class AbstractSQLGenerator

alterTableAlterColumn

public void alterTableAlterColumn(SQLBatch sqls,
                                  java.lang.String table,
                                  java.lang.String column,
                                  TableColumnDataType dataType,
                                  java.lang.Object defaultValue,
                                  boolean changeNotNull,
                                  boolean shouldBeNotNull)
Description copied from class: AbstractSQLGenerator
Parameter notNull may be null if state of "not null constraint" is not to be changed

Specified by:
alterTableAlterColumn in class AbstractSQLGenerator

alterTableSetNotNull

public void alterTableSetNotNull(SQLBatch sqls,
                                 java.lang.String table,
                                 java.lang.String column,
                                 TableColumnDataType currentDataType,
                                 java.lang.Object currentDefaultValue,
                                 boolean notNull)
MSSQL does not support only not null constraint change

Specified by:
alterTableSetNotNull in class AbstractSQLGenerator

dropSequence

public void dropSequence(SQLBatch sqls,
                         java.lang.String sequenceToDrop)
Specified by:
dropSequence in class AbstractSQLGenerator

dropTable

public void dropTable(SQLBatch sqls,
                      java.lang.String tableToDrop)
Specified by:
dropTable in class AbstractSQLGenerator

scanDatabase

public DatabaseSchema scanDatabase(SQLConnector connector,
                                   SQLScannerFilter filter)
                            throws palio.PalioException
Overrides:
scanDatabase in class AbstractSQLGenerator
Throws:
palio.PalioException