org.clazzes.jdbc2xml.schema.impl
Class DropColumnCommand

java.lang.Object
  extended by org.clazzes.jdbc2xml.schema.impl.DropColumnCommand
All Implemented Interfaces:
SqlCommand

public class DropColumnCommand
extends java.lang.Object
implements SqlCommand

This class implements a rollback-enabled variant of a drop column statement.

Author:
wglas

Constructor Summary
DropColumnCommand(TableInfo ti, ColumnInfo ci, Dialect dialect, java.lang.String suffix, java.lang.String addColumnCommand)
          Construct a drop column command with rollback support.
 
Method Summary
 void cleanupOnCommit(java.sql.Connection connection)
          Cleanup resources kept by this command, if the transaction is committed.
 void perform(java.sql.Connection connection)
          Perform an atomic SQL command.
 void rollback(java.sql.Connection connection)
          Roll back an atomic SQL command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DropColumnCommand

public DropColumnCommand(TableInfo ti,
                         ColumnInfo ci,
                         Dialect dialect,
                         java.lang.String suffix,
                         java.lang.String addColumnCommand)
                  throws java.sql.SQLException
Construct a drop column command with rollback support.

Parameters:
ti - The description of the table.
ci - The description of the column to be created.
dialect - The dialect used to build column specs for the reverse operation.
suffix - The RDMBS-specific create table suffix.
Throws:
java.sql.SQLException - Upon unsupported foreign key options.
See Also:
DDLHelper.buildAddColumn(String, ColumnInfo, Dialect, String)
Method Detail

cleanupOnCommit

public void cleanupOnCommit(java.sql.Connection connection)
                     throws java.sql.SQLException
Description copied from interface: SqlCommand
Cleanup resources kept by this command, if the transaction is committed. This might incur deleting temporary backup tables or deleting data files, which back up deleted table data.

Specified by:
cleanupOnCommit in interface SqlCommand
Throws:
java.sql.SQLException

perform

public void perform(java.sql.Connection connection)
             throws java.sql.SQLException
Description copied from interface: SqlCommand
Perform an atomic SQL command.

Specified by:
perform in interface SqlCommand
Parameters:
connection - A JDBC connection on which to perform queries.
Throws:
java.sql.SQLException - Upon database errors.

rollback

public void rollback(java.sql.Connection connection)
              throws java.sql.SQLException
Description copied from interface: SqlCommand
Roll back an atomic SQL command.

Specified by:
rollback in interface SqlCommand
Parameters:
connection - A JDBC connection on which to perform queries.
Throws:
java.sql.SQLException - Upon database errors or when a rollback is not supported.


Copyright © 2007. All Rights Reserved.