com.ninja_squad.dbsetup
Class Operations

java.lang.Object
  extended by com.ninja_squad.dbsetup.Operations

public final class Operations
extends java.lang.Object

A static factory class for operations. Static import of this class can help make the code more readable.


Method Summary
static Operation deleteAllFrom(java.util.List<java.lang.String> tables)
          Creates a sequence of delete from ... operations.
static Operation deleteAllFrom(java.lang.String... tables)
          Creates a sequence of delete from table operations.
static DeleteAll deleteAllFrom(java.lang.String table)
          Creates a delete from table operation.
static Insert.Builder insertInto(java.lang.String table)
          Creates a builder for a sequence of insert operations.
static Operation sequenceOf(java.util.List<? extends Operation> operations)
          Creates a sequence of operations.
static Operation sequenceOf(Operation... operations)
          Creates a sequence of operations.
static Operation sql(java.util.List<java.lang.String> sqlStatements)
          Creates a sequence of SQL operations.
static Operation sql(java.lang.String... sqlStatements)
          Creates a sequence of SQL operations.
static SqlOperation sql(java.lang.String sqlStatement)
          Creates a SQL operation.
static Operation truncate(java.util.List<java.lang.String> tables)
          Creates a sequence of truncate table ... operations.
static Operation truncate(java.lang.String... tables)
          Creates a sequence of truncate table ... operations.
static Truncate truncate(java.lang.String table)
          Creates a truncate table ... operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

deleteAllFrom

public static DeleteAll deleteAllFrom(@Nonnull
                                      java.lang.String table)
Creates a delete from table operation.

Parameters:
table - the table to delete all from
See Also:
DeleteAll

deleteAllFrom

public static Operation deleteAllFrom(@Nonnull
                                      java.lang.String... tables)
Creates a sequence of delete from table operations.

Parameters:
tables - the tables to delete all from
See Also:
DeleteAll

deleteAllFrom

public static Operation deleteAllFrom(@Nonnull
                                      java.util.List<java.lang.String> tables)
Creates a sequence of delete from ... operations.

Parameters:
tables - the tables to delete all from
See Also:
DeleteAll

truncate

public static Truncate truncate(@Nonnull
                                java.lang.String table)
Creates a truncate table ... operation.

Parameters:
table - the table to truncate
See Also:
Truncate

truncate

public static Operation truncate(@Nonnull
                                 java.lang.String... tables)
Creates a sequence of truncate table ... operations.

Parameters:
tables - the tables to truncate
See Also:
Truncate

truncate

public static Operation truncate(@Nonnull
                                 java.util.List<java.lang.String> tables)
Creates a sequence of truncate table ... operations.

Parameters:
tables - the tables to truncate
See Also:
Truncate

sql

public static SqlOperation sql(@Nonnull
                               java.lang.String sqlStatement)
Creates a SQL operation.

Parameters:
sqlStatement - the SQL statement to execute (using Statement.executeUpdate(String))
See Also:
SqlOperation

sql

public static Operation sql(@Nonnull
                            java.lang.String... sqlStatements)
Creates a sequence of SQL operations.

Parameters:
sqlStatements - the SQL statements to execute (using Statement.executeUpdate(String))
See Also:
SqlOperation

sql

public static Operation sql(@Nonnull
                            java.util.List<java.lang.String> sqlStatements)
Creates a sequence of SQL operations.

Parameters:
sqlStatements - the SQL statements to execute (using Statement.executeUpdate(String))
See Also:
SqlOperation

insertInto

public static Insert.Builder insertInto(@Nonnull
                                        java.lang.String table)
Creates a builder for a sequence of insert operations.

Parameters:
table - the table to insert into
See Also:
Insert

sequenceOf

public static Operation sequenceOf(@Nonnull
                                   Operation... operations)
Creates a sequence of operations.

Parameters:
operations - the operations to put in a sequence
See Also:
CompositeOperation

sequenceOf

public static Operation sequenceOf(@Nonnull
                                   java.util.List<? extends Operation> operations)
Creates a sequence of operations.

Parameters:
operations - the operations to put in a sequence
See Also:
CompositeOperation