Package io.micronaut.data.jdbc.mapper
Class JdbcQueryStatement
java.lang.Object
io.micronaut.data.jdbc.mapper.JdbcQueryStatement
- All Implemented Interfaces:
QueryStatement<PreparedStatement,Integer>
A
QueryStatement for a SQL PreparedStatement.- Since:
- 1.0.0
- Author:
- graemerocher
-
Constructor Summary
ConstructorsConstructorDescriptionJdbcQueryStatement(DataConversionService conversionService) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionio.micronaut.core.convert.ConversionServiceGet conversion service.setArray(PreparedStatement statement, Integer name, Object array) Sets an array value for the given name.setBigDecimal(PreparedStatement statement, Integer name, BigDecimal bd) Write a BigDecimal value for the given name.setBoolean(PreparedStatement statement, Integer name, boolean bool) Write a boolean value for the given name.setByte(PreparedStatement statement, Integer name, byte b) Write a byte value for the given name.setBytes(PreparedStatement statement, Integer name, byte[] bytes) Write a byte[] value for the given name.setChar(PreparedStatement statement, Integer name, char value) Write a char value for the given name.setDate(PreparedStatement statement, Integer name, Date date) Write a date value for the given name.setDouble(PreparedStatement statement, Integer name, double d) Write a double value for the given name.setDynamic(PreparedStatement statement, Integer index, DataType dataType, Object value) Write a value dynamically using the result set and the given name and data type.setFloat(PreparedStatement statement, Integer name, float f) Write a float value for the given name.setInt(PreparedStatement statement, Integer name, int integer) Write a int value for the given name.setLong(PreparedStatement statement, Integer name, long value) Write a long value for the given name.setShort(PreparedStatement statement, Integer name, short s) Write a short value for the given name.setString(PreparedStatement statement, Integer name, String string) Write a string value for the given name.setTime(PreparedStatement statement, Integer name, Time instant) Write an instant value for the given name.setTimestamp(PreparedStatement statement, Integer name, Instant instant) Write an instant value for the given name.setValue(PreparedStatement statement, Integer index, Object value) Sets the give given object value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.data.runtime.mapper.QueryStatement
convertRequired
-
Constructor Details
-
JdbcQueryStatement
public JdbcQueryStatement() -
JdbcQueryStatement
Constructs a new instance.- Parameters:
conversionService- The data conversion service- Since:
- 3.1
-
-
Method Details
-
getConversionService
public io.micronaut.core.convert.ConversionService getConversionService()Description copied from interface:QueryStatementGet conversion service.- Specified by:
getConversionServicein interfaceQueryStatement<PreparedStatement,Integer> - Returns:
- the instance of
ConversionService
-
setDynamic
public QueryStatement<PreparedStatement,Integer> setDynamic(@NonNull PreparedStatement statement, @NonNull Integer index, @NonNull DataType dataType, Object value) Description copied from interface:QueryStatementWrite a value dynamically using the result set and the given name and data type.- Specified by:
setDynamicin interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementindex- The indexdataType- The data typevalue- the value- Returns:
- The writer
-
setTimestamp
public QueryStatement<PreparedStatement,Integer> setTimestamp(PreparedStatement statement, Integer name, Instant instant) Description copied from interface:QueryStatementWrite an instant value for the given name.- Specified by:
setTimestampin interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementname- The name (such as the column name)instant- The instant- Returns:
- This writer
-
setTime
public QueryStatement<PreparedStatement,Integer> setTime(PreparedStatement statement, Integer name, Time instant) Description copied from interface:QueryStatementWrite an instant value for the given name.- Specified by:
setTimein interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementname- The name (such as the column name)instant- The time- Returns:
- This writer
-
setValue
public QueryStatement<PreparedStatement,Integer> setValue(PreparedStatement statement, Integer index, Object value) throws DataAccessException Description copied from interface:QueryStatementSets the give given object value.- Specified by:
setValuein interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementindex- The indexvalue- The value- Returns:
- this writer
- Throws:
DataAccessException- if the value cannot be read
-
setLong
@NonNull public QueryStatement<PreparedStatement,Integer> setLong(PreparedStatement statement, Integer name, long value) Description copied from interface:QueryStatementWrite a long value for the given name.- Specified by:
setLongin interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementname- The name (such as the column name)value- The value- Returns:
- This writer
-
setChar
@NonNull public QueryStatement<PreparedStatement,Integer> setChar(PreparedStatement statement, Integer name, char value) Description copied from interface:QueryStatementWrite a char value for the given name.- Specified by:
setCharin interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementname- The name (such as the column name)value- The char value- Returns:
- This writer
-
setDate
@NonNull public QueryStatement<PreparedStatement,Integer> setDate(PreparedStatement statement, Integer name, Date date) Description copied from interface:QueryStatementWrite a date value for the given name.- Specified by:
setDatein interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementname- The name (such as the column name)date- The date- Returns:
- This writer
-
setString
public QueryStatement<PreparedStatement,Integer> setString(PreparedStatement statement, Integer name, String string) Description copied from interface:QueryStatementWrite a string value for the given name.- Specified by:
setStringin interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementname- The name (such as the column name)string- The string- Returns:
- This writer
-
setInt
@NonNull public QueryStatement<PreparedStatement,Integer> setInt(PreparedStatement statement, Integer name, int integer) Description copied from interface:QueryStatementWrite a int value for the given name.- Specified by:
setIntin interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementname- The name (such as the column name)integer- The integer- Returns:
- This writer
-
setBoolean
@NonNull public QueryStatement<PreparedStatement,Integer> setBoolean(PreparedStatement statement, Integer name, boolean bool) Description copied from interface:QueryStatementWrite a boolean value for the given name.- Specified by:
setBooleanin interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementname- The name (such as the column name)bool- The boolean- Returns:
- This writer
-
setFloat
@NonNull public QueryStatement<PreparedStatement,Integer> setFloat(PreparedStatement statement, Integer name, float f) Description copied from interface:QueryStatementWrite a float value for the given name.- Specified by:
setFloatin interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementname- The name (such as the column name)f- The float- Returns:
- This writer
-
setByte
@NonNull public QueryStatement<PreparedStatement,Integer> setByte(PreparedStatement statement, Integer name, byte b) Description copied from interface:QueryStatementWrite a byte value for the given name.- Specified by:
setBytein interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementname- The name (such as the column name)b- The byte- Returns:
- This writer
-
setShort
@NonNull public QueryStatement<PreparedStatement,Integer> setShort(PreparedStatement statement, Integer name, short s) Description copied from interface:QueryStatementWrite a short value for the given name.- Specified by:
setShortin interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementname- The name (such as the column name)s- The short- Returns:
- This writer
-
setDouble
@NonNull public QueryStatement<PreparedStatement,Integer> setDouble(PreparedStatement statement, Integer name, double d) Description copied from interface:QueryStatementWrite a double value for the given name.- Specified by:
setDoublein interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementname- The name (such as the column name)d- The double- Returns:
- This writer
-
setBigDecimal
@NonNull public QueryStatement<PreparedStatement,Integer> setBigDecimal(PreparedStatement statement, Integer name, BigDecimal bd) Description copied from interface:QueryStatementWrite a BigDecimal value for the given name.- Specified by:
setBigDecimalin interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementname- The name (such as the column name)bd- The big decimal- Returns:
- This writer
-
setBytes
@NonNull public QueryStatement<PreparedStatement,Integer> setBytes(PreparedStatement statement, Integer name, byte[] bytes) Description copied from interface:QueryStatementWrite a byte[] value for the given name.- Specified by:
setBytesin interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementname- The name (such as the column name)bytes- the bytes- Returns:
- This writer
-
setArray
@NonNull public QueryStatement<PreparedStatement,Integer> setArray(PreparedStatement statement, Integer name, Object array) Description copied from interface:QueryStatementSets an array value for the given name.- Specified by:
setArrayin interfaceQueryStatement<PreparedStatement,Integer> - Parameters:
statement- The statementname- The name (such as the column name)array- the array- Returns:
- This writer
-