Package io.micronaut.data.runtime.mapper
Class AbstractDelegatingResultReader<RS,ID>
java.lang.Object
io.micronaut.data.runtime.mapper.AbstractDelegatingResultReader<RS,ID>
- Type Parameters:
RS
- The result setID
- The index type
- All Implemented Interfaces:
ResultReader<RS,
ID>
- Direct Known Subclasses:
ColumnNameExistenceAwareR2dbcResultSetReader
,ColumnNameExistenceAwareResultSetReader
@Internal
public abstract class AbstractDelegatingResultReader<RS,ID>
extends Object
implements ResultReader<RS,ID>
The delegating
ResultReader
.- Since:
- 4.9
- Author:
- Denis Stepanov
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractDelegatingResultReader
(ResultReader<RS, ID> delegate) -
Method Summary
Modifier and TypeMethodDescription<T> T
convertRequired
(Object value, io.micronaut.core.type.Argument<T> type) Convert the value to the given type.<T> T
convertRequired
(Object value, Class<T> type) Convert the value to the given type.io.micronaut.core.convert.ConversionService
Get conversion service.<T> T
getRequiredValue
(RS resultSet, ID name, Class<T> type) Get a value from the given result set for the given name and type.boolean
Move the index to the next result if possible.readBigDecimal
(RS resultSet, ID name) Read a BigDecimal value for the given name.boolean
readBoolean
(RS resultSet, ID name) Read a boolean value for the given name.byte
Read a byte value for the given name.byte[]
Read a byte[] value for the given name.char
Read a char value for the given name.Read a date value for the given name.double
readDouble
(RS resultSet, ID name) Read a double value for the given name.readDynamic
(RS resultSet, ID index, DataType dataType) Read a value dynamically using the result set and the given name and data type.float
Read a float value for the given name.int
Read an int value for the given name.long
Read a long value for the given name.short
Read a short value for the given name.readString
(RS resultSet, ID name) Read a string value for the given name.Read a time value for the given index.readTimestamp
(RS resultSet, ID index) Read a timestamp value for the given index.Read a UUID value for the given name.
-
Field Details
-
delegate
-
-
Constructor Details
-
AbstractDelegatingResultReader
-
-
Method Details
-
convertRequired
Description copied from interface:ResultReader
Convert the value to the given type.- Specified by:
convertRequired
in interfaceResultReader<RS,
ID> - Type Parameters:
T
- The generic type- Parameters:
value
- The valuetype
- The type- Returns:
- The converted value
-
convertRequired
Description copied from interface:ResultReader
Convert the value to the given type.- Specified by:
convertRequired
in interfaceResultReader<RS,
ID> - Type Parameters:
T
- The generic type- Parameters:
value
- The valuetype
- The type- Returns:
- The converted value
-
getRequiredValue
Description copied from interface:ResultReader
Get a value from the given result set for the given name and type.- Specified by:
getRequiredValue
in interfaceResultReader<RS,
ID> - Type Parameters:
T
- The generic type- Parameters:
resultSet
- The result setname
- The nametype
- The type- Returns:
- The value
- Throws:
DataAccessException
- if the value cannot be read
-
next
Description copied from interface:ResultReader
Move the index to the next result if possible.- Specified by:
next
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result set- Returns:
- The next result
-
readDynamic
Description copied from interface:ResultReader
Read a value dynamically using the result set and the given name and data type.- Specified by:
readDynamic
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result setindex
- The namedataType
- The data type- Returns:
- The value, can be null
-
readLong
Description copied from interface:ResultReader
Read a long value for the given name.- Specified by:
readLong
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result setname
- The name (such as the column name)- Returns:
- The long value
-
readChar
Description copied from interface:ResultReader
Read a char value for the given name.- Specified by:
readChar
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result setname
- The name (such as the column name)- Returns:
- The char value
-
readDate
Description copied from interface:ResultReader
Read a date value for the given name.- Specified by:
readDate
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result setname
- The name (such as the column name)- Returns:
- The char value
-
readTimestamp
Description copied from interface:ResultReader
Read a timestamp value for the given index.- Specified by:
readTimestamp
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result setindex
- The index (such as the column name)- Returns:
- The char value
-
readTime
Description copied from interface:ResultReader
Read a time value for the given index.- Specified by:
readTime
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result setindex
- The index (such as the column name)- Returns:
- The char value
-
readString
Description copied from interface:ResultReader
Read a string value for the given name.- Specified by:
readString
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result setname
- The name (such as the column name)- Returns:
- The string value
-
readUUID
Description copied from interface:ResultReader
Read a UUID value for the given name.- Specified by:
readUUID
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result setname
- The name (such as the column name)- Returns:
- The string value
-
readInt
Description copied from interface:ResultReader
Read an int value for the given name.- Specified by:
readInt
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result setname
- The name (such as the column name)- Returns:
- The int value
-
readBoolean
Description copied from interface:ResultReader
Read a boolean value for the given name.- Specified by:
readBoolean
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result setname
- The name (such as the column name)- Returns:
- The boolean value
-
readFloat
Description copied from interface:ResultReader
Read a float value for the given name.- Specified by:
readFloat
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result setname
- The name (such as the column name)- Returns:
- The float value
-
readByte
Description copied from interface:ResultReader
Read a byte value for the given name.- Specified by:
readByte
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result setname
- The name (such as the column name)- Returns:
- The byte value
-
readShort
Description copied from interface:ResultReader
Read a short value for the given name.- Specified by:
readShort
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result setname
- The name (such as the column name)- Returns:
- The short value
-
readDouble
Description copied from interface:ResultReader
Read a double value for the given name.- Specified by:
readDouble
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result setname
- The name (such as the column name)- Returns:
- The double value
-
readBigDecimal
Description copied from interface:ResultReader
Read a BigDecimal value for the given name.- Specified by:
readBigDecimal
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result setname
- The name (such as the column name)- Returns:
- The BigDecimal value
-
readBytes
Description copied from interface:ResultReader
Read a byte[] value for the given name.- Specified by:
readBytes
in interfaceResultReader<RS,
ID> - Parameters:
resultSet
- The result setname
- The name (such as the column name)- Returns:
- The byte[] value
-
getConversionService
public io.micronaut.core.convert.ConversionService getConversionService()Description copied from interface:ResultReader
Get conversion service.- Specified by:
getConversionService
in interfaceResultReader<RS,
ID> - Returns:
- the instance of
ConversionService
-