velosurf.model
Class Transaction

java.lang.Object
  extended by velosurf.model.Action
      extended by velosurf.model.Transaction

public class Transaction
extends Action

This class is an action that gather several consecutive update/delete/insert queries.

Author:
Claude Brisson

Field Summary
private  java.util.List<java.util.List<java.lang.String>> paramNamesList
          List of lists of parameter names.
private  java.util.List<java.lang.String> queries
          All the queries.
 
Fields inherited from class velosurf.model.Action
db, paramNames
 
Constructor Summary
Transaction(java.lang.String name, Entity entity)
          Builds a new transaction.
 
Method Summary
 int perform(java.util.Map<java.lang.String,java.lang.Object> source)
          Performs this action.
 void setParamNamesLists(java.util.List<java.util.List<java.lang.String>> paramLists)
          Set the list of list of parameters.
 void setQueries(java.util.List<java.lang.String> queries)
          Set the list of queries.
 java.lang.String toString()
          Debug method.
 
Methods inherited from class velosurf.model.Action
addParamName, buildArrayList, getDB, getEntity, getName, setQuery
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

queries

private java.util.List<java.lang.String> queries
All the queries.


paramNamesList

private java.util.List<java.util.List<java.lang.String>> paramNamesList
List of lists of parameter names.

Constructor Detail

Transaction

public Transaction(java.lang.String name,
                   Entity entity)
Builds a new transaction.

Parameters:
name - transaction name
entity - entity
Method Detail

setQueries

public void setQueries(java.util.List<java.lang.String> queries)
Set the list of queries.

Parameters:
queries - list of SQL queries

setParamNamesLists

public void setParamNamesLists(java.util.List<java.util.List<java.lang.String>> paramLists)
Set the list of list of parameters.

Parameters:
paramLists - list of list of parameters

perform

public int perform(java.util.Map<java.lang.String,java.lang.Object> source)
            throws java.sql.SQLException
Performs this action.

Overrides:
perform in class Action
Parameters:
source - ReadOnlyMap containing parameter values
Returns:
number of affected rows (addition of all the partial counts)
Throws:
java.sql.SQLException - thrown from the database

toString

public java.lang.String toString()
Debug method.

Overrides:
toString in class Action
Returns:
the definition string of the transaction


~ooOoo~