java.lang.Object
io.ebeaninternal.api.BindParams
- All Implemented Interfaces:
Serializable
Parameters used for binding to a statement.
Supports ordered or named parameters.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe bind parameters in the correct binding order.static final classA In Out capable parameter for the CallableStatement. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildQueryPlanHash(StringBuilder builder) Calculate and return a query plan bind hash with total bind count.Return the hash that should be included with the query plan.copy()Return a deep copy of the BindParams.Create a new positioned parameters orderedList.booleanisEmpty()Return true if there are no bind parameters.booleanReturn true if the bind hash and count has not changed.Return a Natural Key bind param if supported.parameter(int position) Return the Parameter for a given position.Return the named parameter.Return the values of ordered parameters.Return the sql with ? place holders (named parameters have been processed and ordered).voidvoidregisterOut(int position, int outType) Register the parameter as an Out parameter using position.voidregisterOut(String name, int outType) Register the named parameter as an Out parameter.booleanReturn true if named parameters are being used and they have not yet been ordered.voidreset()Reset positioned parameters (usually due to bind parameter expansion).voidsetArrayParameter(String name, Collection<?> value) Set a named In parameter that is multi-valued.setEncryptionKey(String name, Object value) Set an encryption key as a bind value.voidsetNextParameter(Object value) Bind the next positioned parameter.voidsetNextParameters(Object... values) voidsetNullParameter(int position, int jdbcType) Set a null parameter using position.voidsetNullParameter(String name, int jdbcType) Set a named In parameter that is null.voidsetParameter(int position, Object value) Using position set the In value of a parameter.voidsetParameter(int position, Object value, int outType) Set an In Out parameter using position.setParameter(String name, Object value) Set a named In parameter that is not null.voidsetParameter(String name, Object value, int outType) Set a named In Out parameter.voidsetPreparedSql(String preparedSql) Set the sql with named parameters replaced with place holder ?.intsize()voidUpdates the hash.
-
Constructor Details
-
BindParams
public BindParams()
-
-
Method Details
-
reset
public void reset()Reset positioned parameters (usually due to bind parameter expansion). -
queryBindHash
-
calcQueryPlanHash
Return the hash that should be included with the query plan.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.
-
buildQueryPlanHash
Calculate and return a query plan bind hash with total bind count. -
copy
Return a deep copy of the BindParams. -
isEmpty
public boolean isEmpty()Return true if there are no bind parameters. -
naturalKeyBindParam
Return a Natural Key bind param if supported. -
size
public int size() -
requiresNamedParamsPrepare
public boolean requiresNamedParamsPrepare()Return true if named parameters are being used and they have not yet been ordered. The sql needs to be prepared (named replaced with ?) and the parameters ordered. -
setNullParameter
public void setNullParameter(int position, int jdbcType) Set a null parameter using position. -
setParameter
Set an In Out parameter using position. -
setNextParameters
-
setNextParameter
Bind the next positioned parameter. -
setParameter
Using position set the In value of a parameter. Note that for nulls you must use setNullParameter. -
registerOut
public void registerOut(int position, int outType) Register the parameter as an Out parameter using position. -
parameter
Return the named parameter. -
parameter
Return the Parameter for a given position. -
setParameter
Set a named In Out parameter. -
setNullParameter
Set a named In parameter that is null. -
setParameter
Set a named In parameter that is not null. -
setArrayParameter
Set a named In parameter that is multi-valued. -
setEncryptionKey
Set an encryption key as a bind value.Needs special treatment as the value should not be included in a log.
-
registerOut
Register the named parameter as an Out parameter. -
positionedParameters
Return the values of ordered parameters. -
setPreparedSql
Set the sql with named parameters replaced with place holder ?. -
preparedSql
Return the sql with ? place holders (named parameters have been processed and ordered). -
isSameBindHash
public boolean isSameBindHash()Return true if the bind hash and count has not changed. -
updateHash
public void updateHash()Updates the hash. -
createOrderedList
Create a new positioned parameters orderedList.
-