public class BindParams extends Object implements Serializable
Supports ordered or named parameters.
| Modifier and Type | Class and Description |
|---|---|
static class |
BindParams.OrderedList
The bind parameters in the correct binding order.
|
static class |
BindParams.Param
A In Out capable parameter for the CallableStatement.
|
| Constructor and Description |
|---|
BindParams() |
| Modifier and Type | Method and Description |
|---|---|
void |
buildQueryPlanHash(HashQueryPlanBuilder builder)
Return the hash that should be included with the query plan.
|
BindParams |
copy()
Return a deep copy of the BindParams.
|
NaturalKeyBindParam |
getNaturalKeyBindParam()
Return a Natural Key bind param if supported.
|
BindParams.Param |
getParameter(int position)
Return the Parameter for a given position.
|
BindParams.Param |
getParameter(String name)
Return the named parameter.
|
String |
getPreparedSql()
Return the sql with ? place holders (named parameters have been processed
and ordered).
|
boolean |
isEmpty()
Return true if there are no bind parameters.
|
List<BindParams.Param> |
positionedParameters()
Return the values of ordered parameters.
|
int |
queryBindHash() |
void |
registerOut(int position,
int outType)
Register the parameter as an Out parameter using position.
|
void |
registerOut(String name,
int outType)
Register the named parameter as an Out parameter.
|
boolean |
requiresNamedParamsPrepare()
Return true if named parameters are being used and they have not yet been
ordered.
|
BindParams.Param |
setEncryptionKey(String name,
Object value)
Set an encryption key as a bind value.
|
void |
setNullParameter(int position,
int jdbcType)
Set a null parameter using position.
|
void |
setNullParameter(String name,
int jdbcType)
Set a named In parameter that is null.
|
void |
setParameter(int position,
Object value)
Using position set the In value of a parameter.
|
void |
setParameter(int position,
Object value,
int outType)
Set an In Out parameter using position.
|
BindParams.Param |
setParameter(String name,
Object value)
Set a named In parameter that is not null.
|
void |
setParameter(String name,
Object value,
int outType)
Set a named In Out parameter.
|
void |
setPreparedSql(String preparedSql)
Set the sql with named parameters replaced with place holder ?.
|
int |
size() |
public int queryBindHash()
public void buildQueryPlanHash(HashQueryPlanBuilder builder)
This is to handle binding collections to in clauses. The number of values in the collection effects the query (number of bind values) and so must be taken into account when calculating the query hash.
public BindParams copy()
public boolean isEmpty()
public NaturalKeyBindParam getNaturalKeyBindParam()
public int size()
public boolean requiresNamedParamsPrepare()
public void setNullParameter(int position,
int jdbcType)
public void setParameter(int position,
Object value,
int outType)
public void setParameter(int position,
Object value)
public void registerOut(int position,
int outType)
public void setParameter(String name, Object value, int outType)
public void setNullParameter(String name, int jdbcType)
public BindParams.Param setParameter(String name, Object value)
public BindParams.Param setEncryptionKey(String name, Object value)
Needs special treatment as the value should not be included in a log.
public void registerOut(String name, int outType)
public BindParams.Param getParameter(int position)
public BindParams.Param getParameter(String name)
public List<BindParams.Param> positionedParameters()
public void setPreparedSql(String preparedSql)
public String getPreparedSql()
Copyright © 2014. All Rights Reserved.