Package io.micronaut.data.runtime.mapper
Interface QueryStatement<PS,IDX> 
- Type Parameters:
- PS- The statement type
- IDX- The index type
- All Known Implementing Classes:
- JdbcQueryStatement,- R2dbcQueryStatement
public interface QueryStatement<PS,IDX> 
An abstract interface over prepared statements.
- 
Method SummaryModifier and TypeMethodDescriptiondefault <T> TconvertRequired(@Nullable Object value, Class<T> type) Convert the value to the given type.default io.micronaut.core.convert.ConversionServiceGet conversion service.default @NonNull QueryStatement<PS,IDX> Sets an array value for the given name.default @NonNull QueryStatement<PS,IDX> setBigDecimal(PS statement, IDX name, BigDecimal bd) Write a BigDecimal value for the given name.default @NonNull QueryStatement<PS,IDX> setBoolean(PS statement, IDX name, boolean bool) Write a boolean value for the given name.default @NonNull QueryStatement<PS,IDX> Write a byte value for the given name.default @NonNull QueryStatement<PS,IDX> Write a byte[] value for the given name.default @NonNull QueryStatement<PS,IDX> Write a char value for the given name.default @NonNull QueryStatement<PS,IDX> Write a date value for the given name.default @NonNull QueryStatement<PS,IDX> Write a double value for the given name.default QueryStatement<PS,IDX> setDynamic(PS statement, IDX index, @NonNull DataType dataType, Object value) Write a value dynamically using the result set and the given name and data type.default @NonNull QueryStatement<PS,IDX> Write a float value for the given name.default @NonNull QueryStatement<PS,IDX> Write a int value for the given name.default @NonNull QueryStatement<PS,IDX> Write a long value for the given name.default @NonNull QueryStatement<PS,IDX> Write a short value for the given name.default QueryStatement<PS,IDX> Write a string value for the given name.default QueryStatement<PS,IDX> Write an instant value for the given name.default @NonNull QueryStatement<PS,IDX> setTimestamp(PS statement, IDX name, Instant instant) Write an instant value for the given name.Sets the give given object value.
- 
Method Details- 
setValueSets the give given object value.- Parameters:
- statement- The statement
- index- The index
- value- The value
- Returns:
- this writer
- Throws:
- DataAccessException- if the value cannot be read
 
- 
setDynamicdefault QueryStatement<PS,IDX> setDynamic(@NonNull PS statement, @NonNull IDX index, @NonNull @NonNull DataType dataType, Object value) Write a value dynamically using the result set and the given name and data type.- Parameters:
- statement- The statement
- index- The index
- dataType- The data type
- value- the value
- Returns:
- The writer
- Throws:
- DataAccessException- if the value cannot be read
 
- 
convertRequiredConvert the value to the given type.- Type Parameters:
- T- The generic type
- Parameters:
- value- The value
- type- The type
- Returns:
- The converted value
- Throws:
- DataAccessException- if the value cannot be converted
 
- 
setLongWrite a long value for the given name.- Parameters:
- statement- The statement
- name- The name (such as the column name)
- value- The value
- Returns:
- This writer
 
- 
setCharWrite a char value for the given name.- Parameters:
- statement- The statement
- name- The name (such as the column name)
- value- The char value
- Returns:
- This writer
 
- 
setDateWrite a date value for the given name.- Parameters:
- statement- The statement
- name- The name (such as the column name)
- date- The date
- Returns:
- This writer
 
- 
setTimestamp@NonNull default @NonNull QueryStatement<PS,IDX> setTimestamp(PS statement, IDX name, Instant instant) Write an instant value for the given name.- Parameters:
- statement- The statement
- name- The name (such as the column name)
- instant- The instant
- Returns:
- This writer
- Since:
- 3.4.2
 
- 
setTimeWrite an instant value for the given name.- Parameters:
- statement- The statement
- name- The name (such as the column name)
- instant- The time
- Returns:
- This writer
- Since:
- 3.8
 
- 
setStringWrite a string value for the given name.- Parameters:
- statement- The statement
- name- The name (such as the column name)
- string- The string
- Returns:
- This writer
 
- 
setIntWrite a int value for the given name.- Parameters:
- statement- The statement
- name- The name (such as the column name)
- integer- The integer
- Returns:
- This writer
 
- 
setBooleanWrite a boolean value for the given name.- Parameters:
- statement- The statement
- name- The name (such as the column name)
- bool- The boolean
- Returns:
- This writer
 
- 
setFloatWrite a float value for the given name.- Parameters:
- statement- The statement
- name- The name (such as the column name)
- f- The float
- Returns:
- This writer
 
- 
setByteWrite a byte value for the given name.- Parameters:
- statement- The statement
- name- The name (such as the column name)
- b- The byte
- Returns:
- This writer
 
- 
setShortWrite a short value for the given name.- Parameters:
- statement- The statement
- name- The name (such as the column name)
- s- The short
- Returns:
- This writer
 
- 
setDoubleWrite a double value for the given name.- Parameters:
- statement- The statement
- name- The name (such as the column name)
- d- The double
- Returns:
- This writer
 
- 
setBigDecimal@NonNull default @NonNull QueryStatement<PS,IDX> setBigDecimal(PS statement, IDX name, BigDecimal bd) Write a BigDecimal value for the given name.- Parameters:
- statement- The statement
- name- The name (such as the column name)
- bd- The big decimal
- Returns:
- This writer
 
- 
setBytesWrite a byte[] value for the given name.- Parameters:
- statement- The statement
- name- The name (such as the column name)
- bytes- the bytes
- Returns:
- This writer
 
- 
setArraySets an array value for the given name.- Parameters:
- statement- The statement
- name- The name (such as the column name)
- array- the array
- Returns:
- This writer
 
- 
getConversionServicedefault io.micronaut.core.convert.ConversionService getConversionService()Get conversion service.- Returns:
- the instance of ConversionService
 
 
-