Package io.micronaut.data.jdbc.mapper
Class ColumnIndexResultSetReader
java.lang.Object
io.micronaut.data.jdbc.mapper.ColumnIndexResultSetReader
- All Implemented Interfaces:
 ResultReader<ResultSet,Integer> 
public final class ColumnIndexResultSetReader
extends Object
implements ResultReader<ResultSet,Integer> 
A reader that uses the column index.
- Since:
 - 1.0.0
 - Author:
 - graemerocher
 
- 
Constructor Summary
ConstructorsConstructorDescriptionColumnIndexResultSetReader(DataConversionService conversionService) Constructs a new instance. - 
Method Summary
Modifier and TypeMethodDescriptionio.micronaut.core.convert.ConversionServiceGet conversion service.<T> TgetRequiredValue(ResultSet resultSet, Integer index, 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.readBigDecimal(ResultSet resultSet, Integer index) Read a BigDecimal value for the given name.booleanreadBoolean(ResultSet resultSet, Integer index) Read a boolean value for the given name.byteRead a byte value for the given name.byte[]Read a byte[] value for the given name.charRead a char value for the given name.Read a date value for the given name.doublereadDouble(ResultSet resultSet, Integer index) Read a double value for the given name.@Nullable ObjectreadDynamic(@NonNull ResultSet resultSet, @NonNull Integer index, @NonNull DataType dataType) Read a value dynamically using the result set and the given name and data type.floatRead a float value for the given name.intRead a int value for the given name.longRead a long value for the given name.shortRead a short value for the given name.@Nullable StringreadString(ResultSet resultSet, Integer index) Read a string value for the given name.Read a time value for the given index.readTimestamp(ResultSet resultSet, Integer index) Read a timestamp value for the given index.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.ResultReader
convertRequired, convertRequired, readUUID 
- 
Constructor Details
- 
ColumnIndexResultSetReader
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:ResultReaderGet conversion service.- Specified by:
 getConversionServicein interfaceResultReader<ResultSet,Integer> - Returns:
 - the instance of 
ConversionService 
 - 
readDynamic
@Nullable public @Nullable Object readDynamic(@NonNull @NonNull ResultSet resultSet, @NonNull @NonNull Integer index, @NonNull @NonNull DataType dataType) Description copied from interface:ResultReaderRead a value dynamically using the result set and the given name and data type.- Specified by:
 readDynamicin interfaceResultReader<ResultSet,Integer> - Parameters:
 resultSet- The result setindex- The namedataType- The data type- Returns:
 - The value, can be null
 
 - 
readTimestamp
Description copied from interface:ResultReaderRead a timestamp value for the given index.- Specified by:
 readTimestampin interfaceResultReader<ResultSet,Integer> - Parameters:
 resultSet- The result setindex- The index (such as the column name)- Returns:
 - The char value
 
 - 
readTime
Description copied from interface:ResultReaderRead a time value for the given index.- Specified by:
 readTimein interfaceResultReader<ResultSet,Integer> - Parameters:
 resultSet- The result setindex- The index (such as the column name)- Returns:
 - The char value
 
 - 
readLong
Description copied from interface:ResultReaderRead a long value for the given name.- Specified by:
 readLongin interfaceResultReader<ResultSet,Integer> - Parameters:
 resultSet- The result setindex- The name (such as the column name)- Returns:
 - The long value
 
 - 
readChar
Description copied from interface:ResultReaderRead a char value for the given name.- Specified by:
 readCharin interfaceResultReader<ResultSet,Integer> - Parameters:
 resultSet- The result setindex- The name (such as the column name)- Returns:
 - The char value
 
 - 
readDate
Description copied from interface:ResultReaderRead a date value for the given name.- Specified by:
 readDatein interfaceResultReader<ResultSet,Integer> - Parameters:
 resultSet- The result setindex- The name (such as the column name)- Returns:
 - The char value
 
 - 
readString
Description copied from interface:ResultReaderRead a string value for the given name.- Specified by:
 readStringin interfaceResultReader<ResultSet,Integer> - Parameters:
 resultSet- The result setindex- The name (such as the column name)- Returns:
 - The string value
 
 - 
readInt
Description copied from interface:ResultReaderRead a int value for the given name.- Specified by:
 readIntin interfaceResultReader<ResultSet,Integer> - Parameters:
 resultSet- The result setindex- The name (such as the column name)- Returns:
 - The int value
 
 - 
readBoolean
Description copied from interface:ResultReaderRead a boolean value for the given name.- Specified by:
 readBooleanin interfaceResultReader<ResultSet,Integer> - Parameters:
 resultSet- The result setindex- The name (such as the column name)- Returns:
 - The boolean value
 
 - 
readFloat
Description copied from interface:ResultReaderRead a float value for the given name.- Specified by:
 readFloatin interfaceResultReader<ResultSet,Integer> - Parameters:
 resultSet- The result setindex- The name (such as the column name)- Returns:
 - The float value
 
 - 
readByte
Description copied from interface:ResultReaderRead a byte value for the given name.- Specified by:
 readBytein interfaceResultReader<ResultSet,Integer> - Parameters:
 resultSet- The result setindex- The name (such as the column name)- Returns:
 - The byte value
 
 - 
readShort
Description copied from interface:ResultReaderRead a short value for the given name.- Specified by:
 readShortin interfaceResultReader<ResultSet,Integer> - Parameters:
 resultSet- The result setindex- The name (such as the column name)- Returns:
 - The short value
 
 - 
readDouble
Description copied from interface:ResultReaderRead a double value for the given name.- Specified by:
 readDoublein interfaceResultReader<ResultSet,Integer> - Parameters:
 resultSet- The result setindex- The name (such as the column name)- Returns:
 - The double value
 
 - 
readBigDecimal
Description copied from interface:ResultReaderRead a BigDecimal value for the given name.- Specified by:
 readBigDecimalin interfaceResultReader<ResultSet,Integer> - Parameters:
 resultSet- The result setindex- The name (such as the column name)- Returns:
 - The BigDecimal value
 
 - 
readBytes
Description copied from interface:ResultReaderRead a byte[] value for the given name.- Specified by:
 readBytesin interfaceResultReader<ResultSet,Integer> - Parameters:
 resultSet- The result setindex- The name (such as the column name)- Returns:
 - The byte[] value
 
 - 
getRequiredValue
public <T> T getRequiredValue(ResultSet resultSet, Integer index, Class<T> type) throws DataAccessException Description copied from interface:ResultReaderGet a value from the given result set for the given name and type.- Specified by:
 getRequiredValuein interfaceResultReader<ResultSet,Integer> - Type Parameters:
 T- The generic type- Parameters:
 resultSet- The result setindex- The nametype- The type- Returns:
 - The value
 - Throws:
 DataAccessException- if the value cannot be read
 - 
next
Description copied from interface:ResultReaderMove the index to the next result if possible.- Specified by:
 nextin interfaceResultReader<ResultSet,Integer> - Parameters:
 resultSet- The result set- Returns:
 - The next result
 
 
 -