java.lang.Object
io.ebeaninternal.server.persist.BatchedPstmt
- All Implemented Interfaces:
SpiProfileTransactionEvent
A batched statement that is held in BatchedPstmtHolder. It has a list of
BatchPostExecute which it will process after the statement is executed.
This can hold CallableStatements as well.
-
Constructor Summary
ConstructorsConstructorDescriptionBatchedPstmt(PreparedStatement pstmt, boolean isGenKeys, String sql, SpiTransaction transaction) Create with a given statement. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(BatchPostExecute batchExecute) Add the BatchPostExecute to the list for post execute processing.voidclose()Close the underlying statement.voidexecuteBatch(boolean getGeneratedKeys) Execute the statement using executeBatch().booleanisEmpty()voidprofile()Add the event information to the profiling transaction.voidregisterInputStreams(List<InputStream> streams) Register any inputStreams that should be closed after execution.int[]results()Return the execution results (row counts).intsize()Return the number of batched statements.sql()Return the sqlstatement(BatchPostExecute postExecute) Return the statement adding the postExecute task.
-
Constructor Details
-
BatchedPstmt
public BatchedPstmt(PreparedStatement pstmt, boolean isGenKeys, String sql, SpiTransaction transaction) throws SQLException Create with a given statement.- Throws:
SQLException
-
-
Method Details
-
size
public int size()Return the number of batched statements. -
isEmpty
public boolean isEmpty() -
sql
Return the sql -
statement
Return the statement adding the postExecute task.- Throws:
SQLException
-
add
Add the BatchPostExecute to the list for post execute processing. -
executeBatch
Execute the statement using executeBatch(). Run any post processing including getGeneratedKeys.- Throws:
SQLException
-
profile
public void profile()Description copied from interface:SpiProfileTransactionEventAdd the event information to the profiling transaction.- Specified by:
profilein interfaceSpiProfileTransactionEvent
-
close
public void close()Close the underlying statement. -
results
public int[] results()Return the execution results (row counts). -
registerInputStreams
Register any inputStreams that should be closed after execution.
-