com.github.springtestdbunit.annotation
Enum DatabaseOperation

java.lang.Object
  extended by java.lang.Enum<DatabaseOperation>
      extended by com.github.springtestdbunit.annotation.DatabaseOperation
All Implemented Interfaces:
Serializable, Comparable<DatabaseOperation>

public enum DatabaseOperation
extends Enum<DatabaseOperation>

Database test operations that can be performed to configure database tables.

Author:
Phillip Webb
See Also:
DatabaseSetup, DatabaseTearDown

Enum Constant Summary
CLEAN_INSERT
          Deletes all rows from a database table when the tables is specified in the dataset and subsequently insert new contents.
DELETE
          Deletes database table rows that matches rows from the dataset.
DELETE_ALL
          Deletes all rows from a database table when the table is specified in the dataset.
INSERT
          Inserts new database tables and contents from the dataset.
REFRESH
          Refresh the contents of existing database tables.
TRUNCATE_TABLE
          Deletes all rows from a database table when the table is specified in the dataset.
UPDATE
          Updates the contents of existing database tables from the dataset.
 
Method Summary
static DatabaseOperation valueOf(String name)
          Returns the enum constant of this type with the specified name.
static DatabaseOperation[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UPDATE

public static final DatabaseOperation UPDATE
Updates the contents of existing database tables from the dataset.


INSERT

public static final DatabaseOperation INSERT
Inserts new database tables and contents from the dataset.


REFRESH

public static final DatabaseOperation REFRESH
Refresh the contents of existing database tables. Rows from the dataset will insert or replace existing data. Any database rows that are not in the dataset remain unaffected.


DELETE

public static final DatabaseOperation DELETE
Deletes database table rows that matches rows from the dataset.


DELETE_ALL

public static final DatabaseOperation DELETE_ALL
Deletes all rows from a database table when the table is specified in the dataset. Tables in the database but not in the dataset remain unaffected.

See Also:
TRUNCATE_TABLE

TRUNCATE_TABLE

public static final DatabaseOperation TRUNCATE_TABLE
Deletes all rows from a database table when the table is specified in the dataset. Tables in the database but not in the dataset are unaffected. Identical to DELETE_ALL expect this operation cannot be rolled back and is supported by less database vendors.

See Also:
DELETE_ALL

CLEAN_INSERT

public static final DatabaseOperation CLEAN_INSERT
Deletes all rows from a database table when the tables is specified in the dataset and subsequently insert new contents. Equivalent to calling DELETE_ALL followed by INSERT.

Method Detail

values

public static DatabaseOperation[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (DatabaseOperation c : DatabaseOperation.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static DatabaseOperation valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2012. All Rights Reserved.