de.akquinet.jbosscc.needle.db.operation.hsql
Class HSQLDeleteOperation

java.lang.Object
  extended by de.akquinet.jbosscc.needle.db.operation.AbstractDBOperation
      extended by de.akquinet.jbosscc.needle.db.operation.hsql.HSQLDeleteOperation
All Implemented Interfaces:
DBOperation
Direct Known Subclasses:
H2DeleteOperation

public class HSQLDeleteOperation
extends AbstractDBOperation

Delete everything from the DB: This cannot be done with the JPA, because the order of deletion matters. Instead we directly use a JDBC connection.


Constructor Summary
HSQLDeleteOperation(JdbcConfiguration configuration)
           
 
Method Summary
protected  void deleteContent(List<String> tables, Statement statement)
          Deletes all contents from the given tables.
protected  void disableReferentialIntegrity(Statement statement)
          Disables the referential constraints of the database, e.g foreign keys.
protected  void enableReferentialIntegrity(Statement statement)
          Enables the referential constraints of the database, e.g foreign keys.
 void setUpOperation()
          Execute the database operation in test setup.
 void tearDownOperation()
          Execute the database operation in test tear down.
 
Methods inherited from class de.akquinet.jbosscc.needle.db.operation.AbstractDBOperation
closeConnection, commit, executeScript, getConnection, getTableNames, openConnection, rollback
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HSQLDeleteOperation

public HSQLDeleteOperation(JdbcConfiguration configuration)
Method Detail

setUpOperation

public void setUpOperation()
                    throws SQLException
Execute the database operation in test setup. No operation implementation.

Throws:
SQLException - if a database access error occurs

tearDownOperation

public void tearDownOperation()
                       throws SQLException
Execute the database operation in test tear down.. Delete all data from all tables given by AbstractDBOperation.getTableNames(java.sql.Connection).

Throws:
SQLException - if a database access error occurs

disableReferentialIntegrity

protected void disableReferentialIntegrity(Statement statement)
                                    throws SQLException
Disables the referential constraints of the database, e.g foreign keys.

Throws:
SQLException - - if a database access error occurs

enableReferentialIntegrity

protected void enableReferentialIntegrity(Statement statement)
                                   throws SQLException
Enables the referential constraints of the database, e.g foreign keys.

Throws:
SQLException - - if a database access error occurs

deleteContent

protected void deleteContent(List<String> tables,
                             Statement statement)
                      throws SQLException
Deletes all contents from the given tables.

Parameters:
tables - a List of table names who are to be deleted.
statement - the Statement to be used for executing a SQL statement.
Throws:
SQLException - - if a database access error occurs


Copyright © 2013 akquinet AG. All Rights Reserved.