Package io.ebeaninternal.server.persist
Class BatchedPstmt
- java.lang.Object
-
- io.ebeaninternal.server.persist.BatchedPstmt
-
- All Implemented Interfaces:
SpiProfileTransactionEvent
public class BatchedPstmt extends Object implements 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
Constructors Constructor Description BatchedPstmt(PreparedStatement pstmt, boolean isGenKeys, String sql, SpiTransaction transaction)
Create with a given statement.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(BatchPostExecute batchExecute)
Add the BatchPostExecute to the list for post execute processing.void
close()
Close the underlying statement.void
executeBatch(boolean getGeneratedKeys)
Execute the statement using executeBatch().int[]
getResults()
Return the execution results (row counts).String
getSql()
Return the sqlPreparedStatement
getStatement(BatchPostExecute postExecute)
Return the statement adding the postExecute task.void
profile()
Add the event information to the profiling transaction.void
registerInputStreams(List<InputStream> inputStreams)
Register any inputStreams that should be closed after execution.int
size()
Return the number of batched statements.
-
-
-
Constructor Detail
-
BatchedPstmt
public BatchedPstmt(PreparedStatement pstmt, boolean isGenKeys, String sql, SpiTransaction transaction) throws SQLException
Create with a given statement.- Throws:
SQLException
-
-
Method Detail
-
size
public int size()
Return the number of batched statements.
-
getStatement
public PreparedStatement getStatement(BatchPostExecute postExecute) throws SQLException
Return the statement adding the postExecute task.- Throws:
SQLException
-
add
public void add(BatchPostExecute batchExecute)
Add the BatchPostExecute to the list for post execute processing.
-
executeBatch
public void executeBatch(boolean getGeneratedKeys) throws SQLException
Execute the statement using executeBatch(). Run any post processing including getGeneratedKeys.- Throws:
SQLException
-
profile
public void profile()
Description copied from interface:SpiProfileTransactionEvent
Add the event information to the profiling transaction.- Specified by:
profile
in interfaceSpiProfileTransactionEvent
-
close
public void close() throws SQLException
Close the underlying statement.- Throws:
SQLException
-
getResults
public int[] getResults()
Return the execution results (row counts).
-
registerInputStreams
public void registerInputStreams(List<InputStream> inputStreams)
Register any inputStreams that should be closed after execution.
-
-