org.openanzo.jdbc.utils.batchable
Class Batchable.BatchOperation

java.lang.Object
  extended by org.openanzo.jdbc.utils.batchable.Batchable.BatchOperation
Direct Known Subclasses:
AciRdbWrapper.BatchDeleteAccessControl, AciRdbWrapper.BatchInsertAccessControl, AciRdbWrapper.BatchUpdateAccessControl, BaseSQL.BatchClearTable, BaseSQL.BatchDropTable, BaseSQL.BatchDropView, BaseSQL.BatchInsertGraph, BaseSQL.BatchLockTable, BaseSQL.BatchRemoveRowsFromTable, BaseSQL.BatchUnlockTable, GlitterSQL.BatchClearTempDatasetTable, GlitterSQL.BatchTruncateTempDatasetTable, GraphSQL.BatchClear, GraphSQL.BatchDeleteStatement, GraphSQL.BatchInsertStatement, InsertStatementsRdbWrapper.BatchCreateIdTable, InsertStatementsRdbWrapper.BatchDeleteTempStatements, InsertStatementsRdbWrapper.BatchDropIdTable, InsertStatementsRdbWrapper.BatchInsertBatchRequestId, InsertStatementsRdbWrapper.BatchInsertTempStatement, InsertStatementsRdbWrapper.BatchSelectTempIdCount, LastTransactionTime.BatchInsertFirstTransactionTime, LastTransactionTime.BatchInsertLastTransactionTime, LastTransactionTime.BatchInsertTransactionTimes, NamedGraphRdbWrapper.BatchDeleteNamedGraph, NamedGraphRdbWrapper.BatchDeleteStatementsForNamedGraph, NamedGraphRdbWrapper.BatchInsertNamedGraph, NamedGraphRdbWrapper.BatchLookupNamedGraphRevision, NodeSQL.BatchInsertCommonValue, NodeSQL.BatchStoreBulkLiteral, NodeSQL.BatchStoreBulkLongLiteral, NodeSQL.BatchStoreBulkLongNode, NodeSQL.BatchStoreBulkNode, NodeSQL.BatchStoreResolveId, NodeSQL.BatchStoreResolveLiteral, NodeSQL.BatchStoreResolveLiteralLong, NodeSQL.BatchStoreResolveNode, NodeSQL.BatchStoreResolveNodeLong, NoSequencesSQL.BatchInsertLiteral, NoSequencesSQL.BatchInsertLongLiteral, NoSequencesSQL.BatchInsertLongNode, NoSequencesSQL.BatchInsertNode, NoSequencesSQL.BatchUpdateNodeID, RoleRdbWrapper.BatchDeleteRole, RoleRdbWrapper.BatchDeleteSubRoleOf, RoleRdbWrapper.BatchInsertRole, RoleRdbWrapper.BatchInsertSubRoleOf, SequencesSQL.BatchInsertLiteral, SequencesSQL.BatchInsertLongLiteral, SequencesSQL.BatchInsertLongNode, SequencesSQL.BatchInsertNode, ServerRdbWrapper.BatchLockTable, ServerRdbWrapper.BatchUnlockTable, StatementRdbWrapper.BatchDeleteStatement, StatementRdbWrapper.BatchInsertStatement, UserRdbWrapper.BatchDeleteUser, UserRdbWrapper.BatchInsertUser, UserRdbWrapper.BatchUpdateUser, UsersRolesRdbWrapper.BatchDeleteUserFromRole, UsersRolesRdbWrapper.BatchInsertUsersRoles, XMLSQL.BatchStoreLongXML, XMLSQL.BatchStoreXML
Enclosing interface:
Batchable

public abstract static class Batchable.BatchOperation
extends java.lang.Object

Base of all operations that are to be delayed and batched later. Batch operations are grouped together according to preparedStatementNames, each prepared statement to be batched must have it's own.


Nested Class Summary
static class Batchable.BatchOperation.ParamKey
          A reference to a an array of template parameters
 
Constructor Summary
Batchable.BatchOperation(java.lang.String preparedStatementName)
          Create a new BatchOperation for preparedStatement
Batchable.BatchOperation(java.lang.String preparedStatementName, java.lang.String[] templateParams)
          Create a new BatchOperation for preparedStatement, with the given template parameters
 
Method Summary
abstract  void addBatch(java.sql.PreparedStatement preparedStatement)
          Called by BatchExecutor when prepared statement is being readied for execution.
 void commitImmediate(PreparedStatementCache cache)
          Commit this Batchable to the DB
 java.lang.String getPreparedStatementName()
          Get the prepared statements name
 Batchable.BatchOperation.ParamKey getTemplateParamKey()
          Get the template parameter key
 java.lang.String[] getTemplateParams()
          Get the template parameters
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Batchable.BatchOperation

public Batchable.BatchOperation(java.lang.String preparedStatementName,
                                java.lang.String[] templateParams)
Create a new BatchOperation for preparedStatement, with the given template parameters

Parameters:
preparedStatementName - name of preparedStatement
templateParams - template parameters to the preparedStatement

Batchable.BatchOperation

public Batchable.BatchOperation(java.lang.String preparedStatementName)
Create a new BatchOperation for preparedStatement

Parameters:
preparedStatementName - name of preparedStatement
Method Detail

getPreparedStatementName

public java.lang.String getPreparedStatementName()
Get the prepared statements name

Returns:
the prepared statements name

getTemplateParams

public java.lang.String[] getTemplateParams()
Get the template parameters

Returns:
the template parameters

getTemplateParamKey

public Batchable.BatchOperation.ParamKey getTemplateParamKey()
Get the template parameter key

Returns:
the template parameter key

commitImmediate

public void commitImmediate(PreparedStatementCache cache)
                     throws java.sql.SQLException
Commit this Batchable to the DB

Parameters:
cache - source of preparedStatements
Throws:
java.sql.SQLException - if there was an exception executing the batch operation

addBatch

public abstract void addBatch(java.sql.PreparedStatement preparedStatement)
                       throws java.sql.SQLException
Called by BatchExecutor when prepared statement is being readied for execution. This adds a new batch onto the preparedStatement in question.

Parameters:
preparedStatement - preparedStatement onto which batch is added
Throws:
java.sql.SQLException - if there was an error adding a batch to the preparedStatement


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