com.ninja_squad.dbsetup.operation
Class CompositeOperation

java.lang.Object
  extended by com.ninja_squad.dbsetup.operation.CompositeOperation
All Implemented Interfaces:
Operation

@Immutable
public final class CompositeOperation
extends java.lang.Object
implements Operation

A composite operation or, in other words, an operation which consists in executing a sequence of other operations.


Method Summary
 boolean equals(java.lang.Object o)
           
 void execute(java.sql.Connection connection, BinderConfiguration configuration)
          Executes the sequence of operations
 int hashCode()
           
static Operation sequenceOf(java.util.List<? extends Operation> operations)
          Creates a new Operation containing all the given operations
static Operation sequenceOf(Operation... operations)
          Creates a new Operation containing all the given operations
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

sequenceOf

public static Operation sequenceOf(@Nonnull
                                   Operation... operations)
Creates a new Operation containing all the given operations

Parameters:
operations - the sequence of operations

sequenceOf

public static Operation sequenceOf(@Nonnull
                                   java.util.List<? extends Operation> operations)
Creates a new Operation containing all the given operations

Parameters:
operations - the sequence of operations

execute

public void execute(java.sql.Connection connection,
                    BinderConfiguration configuration)
             throws java.sql.SQLException
Executes the sequence of operations

Specified by:
execute in interface Operation
Parameters:
connection - the connection used to execute the operation
configuration - the binder configuration, used to get appropriate binders based on the metadata of the prepared statements
Throws:
java.sql.SQLException - as soon as one of the operations in the sequence throws a SQLException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object