org.openanzo.jdbc.utils.batchable
Class BatchOperationQueue

java.lang.Object
  extended by org.openanzo.jdbc.utils.batchable.BatchOperationQueue

public class BatchOperationQueue
extends java.lang.Object

Queue of Batchable operations to execute. Operations of the same type are merged into into one prepared statement batch call.

Author:
Joe Betz

Constructor Summary
BatchOperationQueue(PreparedStatementCache cache)
          Create a new queue
 
Method Summary
 void addBatchable(Batchable.BatchOperation batchOperation)
          Add a Batchable operation to the queue.
 void addBatchable(Batchable batchItem)
          Add a Batchable to the queue
 java.util.TreeMap<java.lang.String,java.util.Map<Batchable.BatchOperation.ParamKey,java.sql.PreparedStatement>> getPreparedStatements()
          Get the preparedStatements within this queue
 boolean getUseTempTables()
          Return true if this queue uses temporary tables
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchOperationQueue

public BatchOperationQueue(PreparedStatementCache cache)
Create a new queue

Parameters:
cache - source of prepared statements
Method Detail

getPreparedStatements

public java.util.TreeMap<java.lang.String,java.util.Map<Batchable.BatchOperation.ParamKey,java.sql.PreparedStatement>> getPreparedStatements()
Get the preparedStatements within this queue

Returns:
the prepared statements within this queue

getUseTempTables

public boolean getUseTempTables()
Return true if this queue uses temporary tables

Returns:
true if this queue uses temporary tables

addBatchable

public void addBatchable(Batchable batchItem)
                  throws java.sql.SQLException
Add a Batchable to the queue

Parameters:
batchItem - batchable to add
Throws:
java.sql.SQLException

addBatchable

public void addBatchable(Batchable.BatchOperation batchOperation)
                  throws java.sql.SQLException
Add a Batchable operation to the queue. If too many operations of a given type have already been added. The current set are executed.

Parameters:
batchOperation - batchable operation to add
Throws:
java.sql.SQLException


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.