public class BatchedPstmtHolder extends Object
The BatchControl 'front ends' the batching by queuing the persist requests and ordering them according to depth and type. This object should only batch statements of a single 'depth' at any given time.
| Constructor and Description |
|---|
BatchedPstmtHolder() |
| Modifier and Type | Method and Description |
|---|---|
void |
addStmt(BatchedPstmt bs,
BatchPostExecute postExecute)
Add a new PreparedStatement wrapped in the BatchStatement object.
|
void |
flush(boolean getGeneratedKeys)
Execute all batched PreparedStatements.
|
int |
getMaxSize()
Return the size of the biggest batched statement.
|
PreparedStatement |
getStmt(String stmtKey,
BatchPostExecute postExecute)
Return the PreparedStatement if it has already been used in this Batch.
|
boolean |
isEmpty()
Return true if the batch has no statements to execute.
|
public PreparedStatement getStmt(String stmtKey, BatchPostExecute postExecute)
public void addStmt(BatchedPstmt bs, BatchPostExecute postExecute)
public boolean isEmpty()
public void flush(boolean getGeneratedKeys)
throws javax.persistence.PersistenceException
getGeneratedKeys - if true try to get generated keys for insertsjavax.persistence.PersistenceExceptionpublic int getMaxSize()
Used to determine when to flush the batch.
Copyright © 2014. All Rights Reserved.