Package org.jdbi.v3.core.statement
Class SqlStatement<This extends SqlStatement<This>>
java.lang.Object
org.jdbi.v3.core.statement.SqlStatement<This>
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- Configurable<This>
- Direct Known Subclasses:
- Call,- PreparedBatch,- Query,- Script,- Update
This class provides the common functions between 
Query and
 Update. It defines most of the argument binding functions
 used by its subclasses.- 
Method SummaryModifier and TypeMethodDescriptionfinal Thisbind(int position, boolean value) Bind an argument positionallyfinal Thisbind(int position, byte value) Bind an argument positionallyfinal Thisbind(int position, byte[] value) Bind an argument positionallyfinal Thisbind(int position, char value) Bind an argument positionallyfinal Thisbind(int position, double value) Bind an argument positionallyfinal Thisbind(int position, float value) Bind an argument positionallyfinal Thisbind(int position, int value) Bind an argument positionallyfinal Thisbind(int position, long value) Bind an argument positionallyfinal Thisbind(int position, short value) Bind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal Thisbind(int position, BigDecimal value) Bind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyfinal ThisBind an argument positionallyUsed if you need to have some exotic parameter bound.final ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal Thisbind(String name, BigDecimal value) Bind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by namefinal ThisBind an argument by nameUsed if you need to have some exotic parameter bound.final ThisBind an Iterable as a SQL array.final ThisBind a Java array as a SQL array, casting each element to a new type.final ThisBind an Iterator as a SQL array.final <T> ThisbindArray(int pos, T... array) Bind a Java array as a SQL array.final ThisBind an Iterable as a SQL array.final ThisBind a Java array as a SQL array, casting each element to a new type.final ThisBind an Iterator as a SQL array.final <T> ThisBind a Java array as a SQL array.final ThisbindASCIIStream(int position, InputStream value, int length) Bind an argument positionallyfinal ThisbindASCIIStream(String name, InputStream value, int length) Bind an argument by nameBinds named parameters from JavaBean properties on the argument.Binds named parameters from JavaBean properties on the bean argument, with the given prefix.final ThisbindBeanList(String key, List<?> values, List<String> propertyNames) Bind a parameter for each value in the given list * number of property names, and defines an attribute as the comma-separated list of parameter references (using colon prefix).final ThisbindBinaryStream(int position, InputStream value, int length) Bind an argument positionallyfinal ThisbindBinaryStream(String name, InputStream value, int length) Bind an argument by namefinal ThisbindBySqlType(int position, Object value, int sqlType) Bind a value using a specific type fromjava.sql.Typesvia PreparedStatement#setObject(int, Object, int)final ThisbindBySqlType(String name, Object value, int sqlType) Bind a value using a specific type fromjava.sql.Typesvia PreparedStatement#setObject(int, Object, int)final ThisbindByType(int position, Object value, Type argumentType) Bind an argument dynamically by the type passed in.final ThisbindByType(int position, Object value, GenericType<?> argumentType) Bind an argument dynamically by the generic type passed in.final ThisbindByType(int position, Object value, QualifiedType<?> argumentType) Bind an argument dynamically by the qualified type passed in.final ThisbindByType(String name, Object value, Type argumentType) Bind an argument dynamically by the type passed in.final ThisbindByType(String name, Object value, GenericType<?> argumentType) Bind an argument dynamically by the generic type passed in.final ThisbindByType(String name, Object value, QualifiedType<?> argumentType) Bind an argument dynamically by the type passed in.bindFields(Object object) Binds public fields of the specified object as arguments for the query.bindFields(String prefix, Object object) Binds public fields of the specified object as arguments for the query.final Thisfinal Thisfinal Thisfinal ThisbindList(BiConsumer<SqlStatement, String> onEmpty, String key, Iterable<?> values) final ThisbindList(BiConsumer<SqlStatement, String> onEmpty, String key, Object... values) final ThisbindList(BiConsumer<SqlStatement, String> onEmpty, String key, Iterator<?> values) final ThisbindList(BiConsumer<SqlStatement, String> onEmpty, String key, List<?> values) Bind a parameter for each value in the given list, and defines an attribute as the comma-separated list of parameter references (using colon prefix).Binds named parameters from a map of String to Object instancesbindMethods(Object object) Binds methods with no parameters on the argument.bindMethods(String prefix, Object object) Binds methods with no parameters on the argument, with the given prefix.final ThisbindMethodsList(String key, Iterable<?> values, List<String> methodNames) For each value given, create a tuple by invoking each given method in order, and bind the tuple into aVALUES (...)format insert clause.bindNamedArgumentFinder(NamedArgumentFinder namedArgumentFinder) Binds a newNamedArgumentFinder.final ThisbindNull(int position, int sqlType) Bind NULL to be set for a given argument.final ThisBind NULL to be set for a given argument.final ThisbindNVarchar(int position, String value) Bind aStringargument positionally, asNVARCHARtype.final ThisbindNVarchar(String name, String value) Bind aStringargument by name, asNVARCHARtype.Binds named parameters from object properties on the argument.Binds named parameters from object properties on the argument.bindPojo(Object pojo, GenericType<?> type) Binds named parameters from object properties on the argument.Binds named parameters from object properties on the bean argument, with the given prefix.Binds named parameters from object properties on the bean argument, with the given prefix.bindPojo(String prefix, Object pojo, GenericType<?> type) Binds named parameters from object properties on the bean argument, with the given prefix.Transfer ownership of the handle to the statement: when the statement is closed, commit the handle's transaction (if one exists) and close the handle.When the statement is closed, roll it back then close the owning Handle.voidclose()final ThisdefineList(String key, Object... values) Define an attribute as the comma-separatedStringfrom the elements of thevaluesargument.final ThisdefineList(String key, List<?> values) Define an attribute as the comma-separatedStringfrom the elements of thevaluesargument.Define all bound arguments that don't already have a definition with a boolean indicating their presence.Returns the configuration registry associated with this object.final StatementContextReturns the statement context associated with this statement.setQueryTimeout(int seconds) Set the query timeout, in seconds, on the prepared statement.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jdbi.v3.core.config.ConfigurableaddCustomizer, configure, define, getConfig, registerArgument, registerArgument, registerArrayType, registerArrayType, registerArrayType, registerArrayType, registerCodecFactory, registerCollector, registerColumnMapper, registerColumnMapper, registerColumnMapper, registerColumnMapper, registerColumnMapper, registerColumnMapper, registerExtension, registerRowMapper, registerRowMapper, registerRowMapper, registerRowMapper, setMapKeyColumn, setMapValueColumn, setSqlArrayArgumentStrategy, setSqlLogger, setSqlParser, setTemplateEngine
- 
Method Details- 
setQueryTimeoutSet the query timeout, in seconds, on the prepared statement.- Parameters:
- seconds- number of seconds before timing out
- Returns:
- the same Query instance
 
- 
cleanupHandleCommitTransfer ownership of the handle to the statement: when the statement is closed, commit the handle's transaction (if one exists) and close the handle.- Returns:
- this
 
- 
cleanupHandleRollbackWhen the statement is closed, roll it back then close the owning Handle.- Returns:
- this
 
- 
bindUsed if you need to have some exotic parameter bound.- Parameters:
- position- position to bindBinaryStream this argument, starting at 0
- argument- exotic argument factory
- Returns:
- the same Query instance
 
- 
bindUsed if you need to have some exotic parameter bound.- Parameters:
- name- name to bindBinaryStream this argument
- argument- exotic argument factory
- Returns:
- the same Query instance
 
- 
bindBeanBinds named parameters from JavaBean properties on the argument.- Parameters:
- bean- source of named parameter values to use as arguments
- Returns:
- modified statement
 
- 
bindBeanBinds named parameters from JavaBean properties on the bean argument, with the given prefix. Example: the prefixfooapplied to a bean propertybarwill be bound asfoo.bar.- Parameters:
- prefix- a prefix to apply to all property names.
- bean- source of named parameter values to use as arguments
- Returns:
- modified statement
 
- 
bindPojoBinds named parameters from object properties on the argument. The type must have been registered with pojo type mapping functionality first, usually by a plugin or configuration.- Parameters:
- pojo- source of named parameter values to use as arguments
- Returns:
- modified statement
- See Also:
 
- 
bindPojoBinds named parameters from object properties on the bean argument, with the given prefix. The type must have been registered with pojo type mapping functionality first, usually by a plugin or configuration.- Parameters:
- prefix- a prefix to apply to all property names.
- pojo- source of named parameter values to use as arguments
- Returns:
- modified statement
- See Also:
 
- 
bindPojoBinds named parameters from object properties on the argument. The type must have been registered with pojo type mapping functionality first, usually by a plugin or configuration.- Parameters:
- pojo- source of named parameter values to use as arguments
- type- the static, possibly generic type of the pojo
- Returns:
- modified statement
- See Also:
 
- 
bindPojoBinds named parameters from object properties on the bean argument, with the given prefix. The type must have been registered with pojo type mapping functionality first, usually by a plugin or configuration.- Parameters:
- prefix- a prefix to apply to all property names.
- pojo- source of named parameter values to use as arguments
- type- the static, possibly generic type of the pojo
- Returns:
- modified statement
- See Also:
 
- 
bindPojoBinds named parameters from object properties on the argument. The type must have been registered with pojo type mapping functionality first, usually by a plugin or configuration.- Parameters:
- pojo- source of named parameter values to use as arguments
- type- the static generic type of the pojo
- Returns:
- modified statement
- See Also:
 
- 
bindPojoBinds named parameters from object properties on the bean argument, with the given prefix. The type must have been registered with pojo type mapping functionality first, usually by a plugin or configuration.- Parameters:
- prefix- a prefix to apply to all property names.
- pojo- source of named parameter values to use as arguments
- type- the static generic type of the pojo
- Returns:
- modified statement
- See Also:
 
- 
bindFieldsBinds public fields of the specified object as arguments for the query.- Parameters:
- object- source of the public fields to bind.
- Returns:
- modified statement
 
- 
bindFieldsBinds public fields of the specified object as arguments for the query.- Parameters:
- prefix- a prefix to apply to all field names.
- object- source of the public fields to bind.
- Returns:
- modified statement
 
- 
bindMethodsBinds methods with no parameters on the argument.- Parameters:
- object- source of methods to use as arguments
- Returns:
- modified statement
 
- 
bindMethodsBinds methods with no parameters on the argument, with the given prefix.- Parameters:
- prefix- a prefix to apply to all property names.
- object- source of methods to use as arguments
- Returns:
- modified statement
 
- 
bindMapBinds named parameters from a map of String to Object instances- Parameters:
- map- map where keys are matched to named parameters in order to bind arguments. Can be null, in which case the binding has no effect.
- Returns:
- modified statement
 
- 
bindNamedArgumentFinderBinds a newNamedArgumentFinder.- Parameters:
- namedArgumentFinder- A NamedArgumentFinder to bind. Can be null.
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindNVarcharBind aStringargument positionally, asNVARCHARtype.- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindNVarcharBind aStringargument by name, asNVARCHARtype.- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindASCIIStreamBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- length- how long is the stream being bound?
- Returns:
- the same Query instance
 
- 
bindASCIIStreamBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- length- bytes to read from value
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBinaryStreamBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- length- the number of bytes in the stream.
- Returns:
- the same Query instance
 
- 
bindBinaryStreamBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- length- bytes to read from value
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- length- number of characters to read
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- length- number of characters to read
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument positionally- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- Returns:
- the same Query instance
 
- 
bindBind an argument by name- Parameters:
- name- token name to bind the parameter to
- value- to bind
- Returns:
- the same Query instance
 
- 
bindByTypeBind an argument dynamically by the type passed in.- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- argumentType- type for value argument
- Returns:
- the same Query instance
 
- 
bindByTypeBind an argument dynamically by the generic type passed in.- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- argumentType- type token for value argument
- Returns:
- the same Query instance
 
- 
bindByTypeBind an argument dynamically by the qualified type passed in.- Parameters:
- position- position to bind the parameter at, starting at 0
- value- to bind
- argumentType- type token for value argument
- Returns:
- the same Query instance
 
- 
bindByTypeBind an argument dynamically by the type passed in.- Parameters:
- name- token name to bind the parameter to
- value- to bind
- argumentType- type for value argument
- Returns:
- the same Query instance
 
- 
bindByTypeBind an argument dynamically by the generic type passed in.- Parameters:
- name- token name to bind the parameter to
- value- to bind
- argumentType- type token for value argument
- Returns:
- the same Query instance
 
- 
bindByTypeBind an argument dynamically by the type passed in.- Parameters:
- name- token name to bind the parameter to
- value- to bind
- argumentType- type for value argument
- Returns:
- the same Query instance
 
- 
bindArrayBind a Java array as a SQL array. Usually you can justbind(int, Object)an array, but this method allows varargs.- Type Parameters:
- T- the array element type
- Parameters:
- name- the name of the parameter to bind
- array- the array to bind
- Returns:
- this Query
 
- 
bindArrayBind a Java array as a SQL array. Usually you can justbind(int, Object)an array, but this method allows varargs.- Type Parameters:
- T- the array element type
- Parameters:
- pos- the position of the parameter to bind
- array- the array to bind
- Returns:
- this Query
 
- 
bindArrayBind a Java array as a SQL array, casting each element to a new type.- Parameters:
- name- the name of the parameter to bind
- elementType- the array element type
- array- the array to bind
- Returns:
- this Query
 
- 
bindArrayBind a Java array as a SQL array, casting each element to a new type.- Parameters:
- pos- the position of the parameter to bind
- elementType- the array element type
- array- the array to bind
- Returns:
- this Query
 
- 
bindArrayBind an Iterable as a SQL array.- Parameters:
- name- the name of the parameter to bind
- elementType- the element type of the Iterable
- iterable- the iterable to bind as an array
- Returns:
- this Query
 
- 
bindArrayBind an Iterable as a SQL array.- Parameters:
- pos- the position of the parameter to bind
- elementType- the element type of the Iterable
- iterable- the iterable to bind as an array
- Returns:
- this Query
 
- 
bindArrayBind an Iterator as a SQL array.- Parameters:
- name- the name of the parameter to bind
- elementType- the element type of the Iterable
- iterator- the iterator to bind as an array
- Returns:
- this Query
 
- 
bindArrayBind an Iterator as a SQL array.- Parameters:
- pos- the position of the parameter to bind
- elementType- the element type of the Iterator
- iterator- the Iterator to bind as an array
- Returns:
- this Query
 
- 
bindNullBind NULL to be set for a given argument.- Parameters:
- name- Named parameter to bind to
- sqlType- The sqlType must be set and is a value from- java.sql.Types
- Returns:
- the same statement instance
 
- 
bindNullBind NULL to be set for a given argument.- Parameters:
- position- position to bind NULL to, starting at 0
- sqlType- The sqlType must be set and is a value from- java.sql.Types
- Returns:
- the same statement instance
 
- 
bindBySqlTypeBind a value using a specific type fromjava.sql.Typesvia PreparedStatement#setObject(int, Object, int)- Parameters:
- name- Named parameter to bind at
- value- Value to bind
- sqlType- The sqlType from java.sql.Types
- Returns:
- self
 
- 
bindBySqlTypeBind a value using a specific type fromjava.sql.Typesvia PreparedStatement#setObject(int, Object, int)- Parameters:
- position- position to bind NULL to, starting at 0
- value- Value to bind
- sqlType- The sqlType from java.sql.Types
- Returns:
- self
 
- 
bindList- Parameters:
- key- attribute name
- values- vararg values that will be comma-spliced into the defined attribute value.
- Returns:
- this
- Throws:
- IllegalArgumentException- if the vararg array is empty.
 
- 
bindList- Parameters:
- onEmpty- handler for null/empty vararg array
- key- attribute name
- values- vararg values that will be comma-spliced into the defined attribute value.
- Returns:
- this
- Throws:
- IllegalArgumentException- if the vararg array is empty.
- See Also:
 
- 
bindList- Parameters:
- key- attribute name
- values- iterable values that will be comma-spliced into the defined attribute value.
- Returns:
- this
- Throws:
- IllegalArgumentException- if the iterable is empty.
 
- 
bindList- Parameters:
- onEmpty- handler for null/empty list
- key- attribute name
- values- iterable values that will be comma-spliced into the defined attribute value.
- Returns:
- this
- Throws:
- IllegalArgumentException- if the iterable is empty.
- See Also:
 
- 
bindList- Parameters:
- key- attribute name
- values- iterator of values that will be comma-spliced into the defined attribute value.
- Returns:
- this
- Throws:
- IllegalArgumentException- if the iterator is empty.
 
- 
bindList- Parameters:
- onEmpty- handler for null/empty list
- key- attribute name
- values- iterator of values that will be comma-spliced into the defined attribute value.
- Returns:
- this
- Throws:
- IllegalArgumentException- if the iterator is empty.
- See Also:
 
- 
bindListBind a parameter for each value in the given list, and defines an attribute as the comma-separated list of parameter references (using colon prefix).Examples: List<String> columnNames = Arrays.asList("id", "name", "created_on"); List<Object> values = Arrays.asList(1, "Alice", LocalDate.now()); handle.createUpdate("insert into things (<columnNames>) values (<values>)") .defineList("columnNames", columnNames) .bindList("values", values) .execute(); List<Integer> ids = Arrays.asList(1, 2, 3); List<Thing> things = handle.createQuery("select * from things where id in (<ids>)") .bindList("ids", ids) .mapTo(Contact.class) .list();- Parameters:
- onEmpty- handler for null/empty list
- key- attribute name
- values- list of values that will be comma-spliced into the defined attribute value.
- Returns:
- this
- Throws:
- IllegalArgumentException- if the list is empty.
- See Also:
 
- 
bindBeanListBind a parameter for each value in the given list * number of property names, and defines an attribute as the comma-separated list of parameter references (using colon prefix). Used to create query similar to: select * from things where (id, foo) in ((1,'abc'),(2,'def'),(3,'ghi'))Examples: List<ThingKey> thingKeys = ... List<Thing> things = handle.createQuery("select * from things where (id, foo) in (<thingKeys>)") .bindBeanList("thingKeys", thingKeys, Arrays.asList("id", "foo")) .mapTo(Contact.class) .list();- Parameters:
- key- attribute name
- values- list of values that will be comma-spliced into the defined attribute value.
- propertyNames- list of properties that will be invoked on the values.
- Returns:
- this
- Throws:
- IllegalArgumentException- if the list of values or properties is empty.
- UnableToCreateStatementException- If a property can't be found on an value or we can't find a Argument for it.
 
- 
bindMethodsListFor each value given, create a tuple by invoking each given method in order, and bind the tuple into aVALUES (...)format insert clause.- Parameters:
- key- attribute name
- values- list of values that will be comma-spliced into the defined attribute value
- methodNames- list of methods that will be invoked on the values
- Returns:
- this
- Throws:
- IllegalArgumentException- if the list of values or properties is empty.
- UnableToCreateStatementException- if the method cannot be found
 
- 
defineListDefine an attribute as the comma-separatedStringfrom the elements of thevaluesargument.Examples: handle.createUpdate("insert into things (<columnNames>) values (<values>)") .defineList("columnNames", "id", "name", "created_on") .bindList("values", 1, "Alice", LocalDate.now()) .execute(); List<Thing> things = handle.createQuery("select <columnNames> from things") .bindList("columnNames", "id", "name", "created_on") .mapTo(Contact.class) .list();- Parameters:
- key- attribute name
- values- vararg values that will be comma-spliced into the defined attribute value.
- Returns:
- this
- Throws:
- IllegalArgumentException- if the vararg array is empty, or contains any null elements.
 
- 
defineListDefine an attribute as the comma-separatedStringfrom the elements of thevaluesargument.Examples: List<String> columnNames = Arrays.asList("id", "name", "created_on"); List<Object> values = Arrays.asList(1, "Alice", LocalDate.now()); handle.createUpdate("insert into things (<columnNames>) values (<values>)") .defineList("columnNames", columnNames) .bindList("values", 1, values) .execute(); List<String> columnNames = Arrays.asList("id", "name", "created_on"); List<Thing> things = handle.createQuery("select <columnNames> from things") .bindList("columnNames", columnNames) .mapTo(Contact.class) .list();- Parameters:
- key- attribute name
- values- list of values that will be comma-spliced into the defined attribute value.
- Returns:
- this
- Throws:
- IllegalArgumentException- if the list is empty, or contains any null elements.
 
- 
defineNamedBindingsDefine all bound arguments that don't already have a definition with a boolean indicating their presence. Useful to easily template optional properties of pojos or beans like<if(property)>property = :property<endif>.- Returns:
- this
 
- 
getHandle
- 
getConfigDescription copied from interface:ConfigurableReturns the configuration registry associated with this object.- Specified by:
- getConfigin interface- Configurable<This>
- Returns:
- the configuration registry associated with this object.
 
- 
getContextReturns the statement context associated with this statement.- Returns:
- the statement context associated with this statement.
 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
 
 
-