public final class SqlStatements extends Object implements JdbiConfig<SqlStatements>
SqlStatements.| Constructor and Description |
|---|
SqlStatements() |
| Modifier and Type | Method and Description |
|---|---|
SqlStatements |
addCustomizer(StatementCustomizer customizer)
Provides a means for custom statement modification.
|
SqlStatements |
createCopy()
Returns a copy of this configuration object.
|
SqlStatements |
define(String key,
Object value)
Define an attribute for
StatementContext for statements executed by Jdbi. |
SqlStatements |
defineMap(Map<String,?> values)
Defines attributes for each key/value pair in the Map.
|
Object |
getAttribute(String key)
Obtain the value of an attribute
|
Map<String,Object> |
getAttributes()
Returns the attributes which will be applied to
SQL statements created by Jdbi. |
Integer |
getQueryTimeout() |
SqlLogger |
getSqlLogger() |
SqlParser |
getSqlParser() |
TemplateEngine |
getTemplateEngine() |
boolean |
isUnusedBindingAllowed() |
SqlStatements |
setQueryTimeout(Integer seconds)
Jdbi does not implement its own timeout mechanism: it simply calls
Statement.setQueryTimeout(int), leaving timeout handling to your jdbc driver. |
SqlStatements |
setSqlLogger(SqlLogger sqlLogger) |
SqlStatements |
setSqlParser(SqlParser sqlParser)
Sets the
SqlParser used to parse parameters in SQL statements
executed by Jdbi. |
SqlStatements |
setTemplateEngine(TemplateEngine templateEngine)
Sets the
TemplateEngine used to render SQL for all
SQL statements executed by Jdbi. |
SqlStatements |
setUnusedBindingAllowed(boolean allowUnusedBindings)
Sets whether or not an exception should be thrown when any arguments are given to a query but not actually used in it.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetRegistrypublic SqlStatements addCustomizer(StatementCustomizer customizer)
Query.setMaxRows(int)customizer - instance to be used to customize a statementpublic SqlStatements createCopy()
JdbiConfigcreateCopy in interface JdbiConfig<SqlStatements>public SqlStatements define(String key, Object value)
StatementContext for statements executed by Jdbi.key - the key for the attributevalue - the value for the attributepublic SqlStatements defineMap(Map<String,?> values)
values - map of attributes to define.public Object getAttribute(String key)
key - the name of the attributepublic Map<String,Object> getAttributes()
SQL statements created by Jdbi.public SqlLogger getSqlLogger()
public SqlParser getSqlParser()
public TemplateEngine getTemplateEngine()
public boolean isUnusedBindingAllowed()
@Beta public SqlStatements setQueryTimeout(@Nullable Integer seconds)
Statement.setQueryTimeout(int), leaving timeout handling to your jdbc driver.seconds - the time in seconds to wait for a query to complete; 0 to disable the timeout; null to leave it at defaults (i.e. Jdbi will not call setQueryTimeout(int))public SqlStatements setSqlLogger(SqlLogger sqlLogger)
public SqlStatements setSqlParser(SqlParser sqlParser)
SqlParser used to parse parameters in SQL statements
executed by Jdbi. The default parses colon-prefixed named parameter
tokens, e.g. :name.sqlParser - the new SQL parser.public SqlStatements setTemplateEngine(TemplateEngine templateEngine)
TemplateEngine used to render SQL for all
SQL statements executed by Jdbi. The default
engine replaces <name>-style tokens
with attributes defined
on the statement context.templateEngine - the new template engine.public SqlStatements setUnusedBindingAllowed(boolean allowUnusedBindings)
allowUnusedBindings - the new settingArgumentCopyright © 2019. All rights reserved.