palio.connectors.schema.generators
Class PostgreSQLGenerator

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

public class PostgreSQLGenerator
extends AbstractSQLGenerator

Database base scanning done by Damian Turczynski.

Author:
Szymon Kuklewicz

Constructor Summary
PostgreSQLGenerator()
           
 
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)
          Some databases require repeating of column data type where some don't so user should not expect that this operation may change column data type as well.
 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, areConstraintsViolateColumnDataTypeChange, createIndex, dropIndex
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostgreSQLGenerator

public PostgreSQLGenerator()
Method Detail

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)
Description copied from class: AbstractSQLGenerator
Some databases require repeating of column data type where some don't so user should not expect that this operation may change column data type as well.

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