Package io.micronaut.data.runtime.mapper
Interface ResultReader<RS,IDX> 
- Type Parameters:
- RS- The result set
- IDX- The index type
- All Known Implementing Classes:
- ColumnIndexR2dbcResultReader,- ColumnIndexResultSetReader,- ColumnNameR2dbcResultReader,- ColumnNameResultSetReader
public interface ResultReader<RS,IDX> 
A result reader is a type that is capable of reading data from the given result set type.
- 
Method SummaryModifier and TypeMethodDescriptiondefault <T> TconvertRequired(@NonNull Object value, io.micronaut.core.type.Argument<T> type) Convert the value to the given type.default <T> TconvertRequired(@NonNull Object value, Class<T> type) Convert the value to the given type.default io.micronaut.core.convert.ConversionServiceGet conversion service.<T> TgetRequiredValue(RS resultSet, IDX name, Class<T> type) Get a value from the given result set for the given name and type.booleanMove the index to the next result if possible.default BigDecimalreadBigDecimal(RS resultSet, IDX name) Read a BigDecimal value for the given name.default booleanreadBoolean(RS resultSet, IDX name) Read a boolean value for the given name.default byteRead a byte value for the given name.default byte[]Read a byte[] value for the given name.default charRead a char value for the given name.default DateRead a date value for the given name.default doublereadDouble(RS resultSet, IDX name) Read a double value for the given name.default @Nullable ObjectreadDynamic(RS resultSet, IDX index, @NonNull DataType dataType) Read a value dynamically using the result set and the given name and data type.default floatRead a float value for the given name.default intRead a int value for the given name.default longRead a long value for the given name.default shortRead a short value for the given name.default @Nullable StringreadString(RS resultSet, IDX name) Read a string value for the given name.default TimeRead a time value for the given index.default DatereadTimestamp(RS resultSet, IDX index) Read a timestamp value for the given index.default @Nullable UUIDRead a UUID value for the given name.
- 
Method Details- 
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
 
- 
convertRequireddefault <T> T convertRequired(@NonNull @NonNull Object value, io.micronaut.core.type.Argument<T> type) Convert 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
 
- 
getRequiredValueGet a value from the given result set for the given name and type.- Type Parameters:
- T- The generic type
- Parameters:
- resultSet- The result set
- name- The name
- type- The type
- Returns:
- The value
- Throws:
- DataAccessException- if the value cannot be read
 
- 
nextMove the index to the next result if possible.- Parameters:
- resultSet- The result set
- Returns:
- The next result
 
- 
readDynamic@Nullable default @Nullable Object readDynamic(@NonNull RS resultSet, @NonNull IDX index, @NonNull @NonNull DataType dataType) Read a value dynamically using the result set and the given name and data type.- Parameters:
- resultSet- The result set
- index- The name
- dataType- The data type
- Returns:
- The value, can be null
- Throws:
- DataAccessException- if the value cannot be read
 
- 
readLongRead a long value for the given name.- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The long value
 
- 
readCharRead a char value for the given name.- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The char value
 
- 
readDateRead a date value for the given name.- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The char value
 
- 
readTimestampRead a timestamp value for the given index.- Parameters:
- resultSet- The result set
- index- The index (such as the column name)
- Returns:
- The char value
 
- 
readTimeRead a time value for the given index.- Parameters:
- resultSet- The result set
- index- The index (such as the column name)
- Returns:
- The char value
 
- 
readStringRead a string value for the given name.- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The string value
 
- 
readUUIDRead a UUID value for the given name.- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The string value
 
- 
readIntRead a int value for the given name.- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The int value
 
- 
readBooleanRead a boolean value for the given name.- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The boolean value
 
- 
readFloatRead a float value for the given name.- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The float value
 
- 
readByteRead a byte value for the given name.- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The byte value
 
- 
readShortRead a short value for the given name.- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The short value
 
- 
readDoubleRead a double value for the given name.- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The double value
 
- 
readBigDecimalRead a BigDecimal value for the given name.- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The BigDecimal value
 
- 
readBytesRead a byte[] value for the given name.- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The byte[] value
 
- 
getConversionServicedefault io.micronaut.core.convert.ConversionService getConversionService()Get conversion service.- Returns:
- the instance of ConversionService
 
 
-