|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.skife.jdbi.v2.SQLStatement<PreparedBatch>
org.skife.jdbi.v2.PreparedBatch
public class PreparedBatch
Represents a prepared batch statement. That is, a sql statement compiled as a prepared statement, and then executed multiple times in a single batch. This is, generally, a very efficient way to execute large numbers of the same statement where the statement only varies by the arguments bound to it.
Method Summary | |
---|---|
PreparedBatchPart |
add()
Add a statement (part) to this batch. |
PreparedBatchPart |
add(Map<String,? extends Object> args)
Create a new batch part by binding values looked up in args to
named parameters on the statement. |
PreparedBatch |
add(Object... args)
|
protected void |
addCleanable(Cleanable cleanable)
|
protected void |
addCustomizer(StatementCustomizer customizer)
|
protected void |
addCustomizers(Collection<StatementCustomizer> customizers)
|
protected void |
afterExecution(PreparedStatement stmt)
|
protected void |
beforeExecution(PreparedStatement stmt)
|
protected void |
cleanup()
|
PreparedBatch |
define(Map<String,? extends Object> values)
Adds all key/value pairs in the Map to the StatementContext . |
PreparedBatch |
define(String key,
Object value)
Specify a value on the statement context for this batch |
int[] |
execute()
Execute the batch |
protected ConcreteStatementContext |
getConcreteContext()
|
StatementContext |
getContext()
Obtain the statement context associated with this statement |
protected org.skife.jdbi.v2.Foreman |
getForeman()
|
protected Binding |
getParams()
|
int |
getSize()
The number of statements which are in this batch |
protected Collection<StatementCustomizer> |
getStatementCustomizers()
|
int |
size()
The number of statements which are in this batch |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public PreparedBatchPart add()
public PreparedBatchPart add(Map<String,? extends Object> args)
args
to
named parameters on the statement.
args
- map to bind arguments from for named parameters on the statement
public PreparedBatch add(Object... args)
public PreparedBatch define(Map<String,? extends Object> values)
StatementContext
.
define
in class SQLStatement<PreparedBatch>
values
- containing key/value pairs.
public PreparedBatch define(String key, Object value)
define
in class SQLStatement<PreparedBatch>
key
- Key to access this value from the StatementContextvalue
- Value to setAttribute on the StatementContext
public int[] execute()
protected Binding getParams()
getParams
in class SQLStatement<PreparedBatch>
public int getSize()
public int size()
protected void addCleanable(Cleanable cleanable)
protected void addCustomizer(StatementCustomizer customizer)
protected void addCustomizers(Collection<StatementCustomizer> customizers)
protected final void afterExecution(PreparedStatement stmt)
protected final void beforeExecution(PreparedStatement stmt)
protected final void cleanup()
protected final ConcreteStatementContext getConcreteContext()
public final StatementContext getContext()
protected final org.skife.jdbi.v2.Foreman getForeman()
protected Collection<StatementCustomizer> getStatementCustomizers()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |