com.bm.utils
Class UndoScriptGenerator<T>

java.lang.Object
  extended by com.bm.utils.UndoScriptGenerator<T>
Type Parameters:
T - - the type of the entity bean

public class UndoScriptGenerator<T>
extends java.lang.Object

This class generates a undo script for all DB oprations excuted in jUnit. tests

Since:
07.10.2005
Author:
Daniel Wiese

Constructor Summary
UndoScriptGenerator(EntityBeanIntrospector<T> inspector)
          Default constructor.
 
Method Summary
 void deleteAllDataInAllUsedTables(javax.persistence.EntityManager em)
          Deteltes all data in all used tables.
 java.util.List<java.lang.Object> getCreatedObjects()
          Returns the createdObjects.
 java.util.List<java.lang.String> getOneDeleteAllStatement()
          This method returns a delete all statement for the tables (bean types).
 java.util.List<java.lang.String> getSQLUndoStatements()
          Returns a list of SQL undo statements.
 void protokollCreate(T toCreate)
          This method protocoll a bean creation.
 java.lang.String toString()
          The toString method- returns the undo-script.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UndoScriptGenerator

public UndoScriptGenerator(EntityBeanIntrospector<T> inspector)
Default constructor.

Parameters:
inspector - - the inspector
Method Detail

getCreatedObjects

public java.util.List<java.lang.Object> getCreatedObjects()
Returns the createdObjects.

Returns:
Returns the createdObjects.

getOneDeleteAllStatement

public java.util.List<java.lang.String> getOneDeleteAllStatement()
This method returns a delete all statement for the tables (bean types).

Returns:
delete all statement

deleteAllDataInAllUsedTables

public void deleteAllDataInAllUsedTables(javax.persistence.EntityManager em)
Deteltes all data in all used tables.

Parameters:
em - the entity manager

getSQLUndoStatements

public java.util.List<java.lang.String> getSQLUndoStatements()
Returns a list of SQL undo statements.

Returns:
SQL statements

protokollCreate

public void protokollCreate(T toCreate)
This method protocoll a bean creation.

Parameters:
toCreate - - the ben wich sould be protocolled as created

toString

public java.lang.String toString()
The toString method- returns the undo-script.

Overrides:
toString in class java.lang.Object
Returns:
- list of undo statements
See Also:
Object.toString()


Copyright © 2008. All Rights Reserved.