public class PreparedBatch extends SqlStatement<PreparedBatch> implements ResultBearing
SqlStatement binding methods, and then call
add() to add the current binding as a batch and then clear it.
An entire batch can be bound and added in one go with add(Map)
or add(Object...).| Constructor and Description |
|---|
PreparedBatch(Handle handle,
String sql) |
| Modifier and Type | Method and Description |
|---|---|
PreparedBatch |
add()
Add the current binding as a saved batch and clear the binding.
|
PreparedBatch |
add(Map<String,?> args)
Bind arguments from a Map, add the binding as a saved batch,
then clear the current binding.
|
PreparedBatch |
add(Object... args)
Bind arguments positionally, add the binding as a saved batch, and
then clear the current binding.
|
This |
addCustomizer(StatementCustomizer customizer)
Provides a means for custom statement modification.
|
void |
close() |
int[] |
execute()
Execute the batch
|
<R> R |
execute(ResultProducer<R> producer)
Executes the batch, returning the result obtained from the given
ResultProducer. |
ResultIterator<Integer> |
executeAndGetModCount() |
ResultBearing |
executeAndReturnGeneratedKeys(String... columnNames) |
ConfigRegistry |
getConfig()
Returns the configuration registry associated with this object.
|
StatementContext |
getContext() |
Handle |
getHandle() |
<R> R |
mapResultSet(ResultSetMapper<R> mapper)
Invokes the mapper with a result set supplier, and returns the value returned by the mapper.
|
int |
size() |
bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bindASCIIStream, bindASCIIStream, bindBean, bindBean, bindBeanList, bindBinaryStream, bindBinaryStream, bindBySqlType, bindBySqlType, bindByType, bindByType, bindByType, bindByType, bindList, bindList, bindMap, bindNamedArgumentFinder, bindNull, bindNull, cleanupHandleCommit, cleanupHandleRollback, defineList, defineList, getBinding, getSql, setFetchDirection, setQueryTimeoutclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcollectInto, collectInto, collectInto, map, map, mapTo, mapTo, mapTo, mapToBean, mapToMap, of, reduceResultSet, reduceRowsconfigure, define, getConfig, registerArgument, registerArrayType, registerArrayType, registerArrayType, registerCollector, registerColumnMapper, registerColumnMapper, registerColumnMapper, registerExtension, registerRowMapper, registerRowMapper, registerRowMapper, setSqlArrayArgumentStrategy, setSqlParser, setTemplateEngine, setTimingCollectorpublic PreparedBatch add()
public PreparedBatch add(Map<String,?> args)
args - map to bind arguments from for named parameters on the statementpublic PreparedBatch add(Object... args)
args - the positional arguments to bindpublic int[] execute()
public <R> R execute(ResultProducer<R> producer)
ResultProducer.R - the type of the resultproducer - the result producer.public ResultIterator<Integer> executeAndGetModCount()
public ResultBearing executeAndReturnGeneratedKeys(String... columnNames)
public <R> R mapResultSet(ResultSetMapper<R> mapper)
ResultBearingmapResultSet in interface ResultBearingR - result type returned by the mapper.mapper - result set mapperpublic int size()
public final This addCustomizer(StatementCustomizer customizer)
Query.setMaxRows(int)customizer - instance to be used to customize a statementpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic ConfigRegistry getConfig()
ConfigurablegetConfig in interface Configurable<This>public final StatementContext getContext()
public Handle getHandle()
Copyright © 2017. All rights reserved.