Interface Statement
- All Known Subinterfaces:
- BatchInsertStatement,- DeleteStatement,- InsertStatement,- SelectStatement,- UpdateStatement
- All Known Implementing Classes:
- BatchInsertStatementDefault,- DeleteStatementDefault,- InsertStatementDefault,- SelectStatementDefault,- StatementBase,- UpdateStatementDefault
public interface Statement
Note that the connection used by a Stement is
 not closed after the statement has
 been executed.
 
 Have a look at JdbcScope to manage the 
 closing of connections properly.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclearSql()Clears the current SQL query being built.voidclearSql(boolean keepCurrentBoundParams) Clears the current SQL query being built.getSql(boolean friendly) Returns the current SQL query.voidsetBoolean(String paramName, Boolean value) voidvoidvoidvoidsetInInteger(String paramName, Set<Integer> items) Explodes a collection of Integer and replaces the specified param with them, so it can be used inside a <codeIN(:ids)</code sectionvoidExplodes a collection of Long and replaces the specified param with them, so it can be used inside a <codeIN(:ids)</code sectionvoidsetInstant(String string, Instant instant) This replaces setTimestamp()!voidsetInString(String paramName, Set<String> items) Explodes a collection of String and replaces the specified param with them, so it can be used inside aIN(:ids)section.voidsetInStringFromEnumNames(String paramName, Enum<?>... enumItems) Uses a list of enum names so it can be used inside aIN(:ids)section.voidsetInStringFromEnumNames(String paramName, Set<? extends Enum<?>> enumItems) Explodes a collection of enum names and replaces the specified param with them, so it can be used inside aIN(:ids)section.voidsetInteger(String paramName, Integer value) voidvoidsetLongList(String paramName, List<Long> items) Explodes a list of Long and replaces the specified param with them, so it can be used to replace a "ids list" inside a (PostgreSQL example):INNER JOIN UNNEST('{:idsList}'::int[]) WITH ORDINALITY o(id, ord) ON o.id = myMainTable.idvoidvoidAppends some SQL to the query to launch.
- 
Method Details- 
sqlAppends some SQL to the query to launch. If you want to restart the query from scratch, you need to callclearSql()first!
- 
clearSqlvoid clearSql()Clears the current SQL query being built. Also removes any bound parameters.
- 
clearSqlvoid clearSql(boolean keepCurrentBoundParams) Clears the current SQL query being built.- Parameters:
- keepCurrentBoundParams- if- true, the currently bound parameters won't be cleared, only the query.
 
- 
getSqlReturns the current SQL query.
- 
setInstantThis replaces setTimestamp()!
- 
setDate
- 
setBoolean
- 
setString
- 
setInteger
- 
setLong
- 
setFloat
- 
setDouble
- 
setInLongExplodes a collection of Long and replaces the specified param with them, so it can be used inside a <codeIN(:ids)</code section
- 
setInIntegerExplodes a collection of Integer and replaces the specified param with them, so it can be used inside a <codeIN(:ids)</code section
- 
setInStringExplodes a collection of String and replaces the specified param with them, so it can be used inside aIN(:ids)section.
- 
setInStringFromEnumNamesExplodes a collection of enum names and replaces the specified param with them, so it can be used inside aIN(:ids)section.
- 
setInStringFromEnumNamesUses a list of enum names so it can be used inside aIN(:ids)section.
- 
setLongListExplodes a list of Long and replaces the specified param with them, so it can be used to replace a "ids list" inside a (PostgreSQL example):INNER JOIN UNNEST('{:idsList}'::int[]) WITH ORDINALITY o(id, ord) ON o.id = myMainTable.idThis allows to retrieve a list of rows, using ids, *in the order the ids are specified*. 
 
-