Class ColumnNameCallableResultReader
java.lang.Object
io.micronaut.data.jdbc.mapper.ColumnNameCallableResultReader
- All Implemented Interfaces:
ResultReader<CallableStatement, String>
@Internal
public final class ColumnNameCallableResultReader
extends Object
implements ResultReader<CallableStatement, String>
A
ResultReader for JDBC that uses the column name.- Since:
- 4.2.0
- Author:
- Denis Stepanov
-
Constructor Summary
ConstructorsConstructorDescriptionColumnNameCallableResultReader(DataConversionService conversionService) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescription<T> TconvertRequired(Object value, Class<T> type) Convert the value to the given type.io.micronaut.core.convert.ConversionServiceGet conversion service.<T> @Nullable TgetRequiredValue(CallableStatement cs, String 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.readBigDecimal(CallableStatement cs, String name) Read a BigDecimal value for the given name.booleanreadBoolean(CallableStatement cs, String name) Read a boolean value for the given name.bytereadByte(CallableStatement cs, String name) Read a byte value for the given name.byte[]readBytes(CallableStatement cs, String name) Read a byte[] value for the given name.charreadChar(CallableStatement cs, String name) Read a char value for the given name.@Nullable DatereadDate(CallableStatement cs, String name) Read a date value for the given name.doublereadDouble(CallableStatement cs, String name) Read a double value for the given name.@Nullable ObjectreadDynamic(CallableStatement cs, String index, DataType dataType) Read a value dynamically using the result set and the given name and data type.floatreadFloat(CallableStatement cs, String name) Read a float value for the given name.intreadInt(CallableStatement cs, String name) Read an int value for the given name.longreadLong(CallableStatement cs, String name) Read a long value for the given name.shortreadShort(CallableStatement cs, String name) Read a short value for the given name.@Nullable StringreadString(CallableStatement cs, String name) Read a string value for the given name.@Nullable TimereadTime(CallableStatement cs, String index) Read a time value for the given index.@Nullable DatereadTimestamp(CallableStatement cs, String index) Read a timestamp value for the given index.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResultReader
convertRequired, getRequiredValueNonNull, readUUID
-
Constructor Details
-
ColumnNameCallableResultReader
Constructs a new instance.- Parameters:
conversionService- The data conversion service
-
-
Method Details
-
getConversionService
public io.micronaut.core.convert.ConversionService getConversionService()Description copied from interface:ResultReaderGet conversion service.- Specified by:
getConversionServicein interfaceResultReader<CallableStatement, String>- Returns:
- the instance of
ConversionService
-
readDynamic
Description copied from interface:ResultReaderRead a value dynamically using the result set and the given name and data type.- Specified by:
readDynamicin interfaceResultReader<CallableStatement, String>- Parameters:
cs- The result setindex- The namedataType- The data type- Returns:
- The value, can be null
-
next
Description copied from interface:ResultReaderMove the index to the next result if possible.- Specified by:
nextin interfaceResultReader<CallableStatement, String>- Parameters:
cs- The result set- Returns:
- The next result
-
convertRequired
Description copied from interface:ResultReaderConvert the value to the given type.- Specified by:
convertRequiredin interfaceResultReader<CallableStatement, String>- Type Parameters:
T- The generic type- Parameters:
value- The valuetype- The type- Returns:
- The converted value
-
readTimestamp
Description copied from interface:ResultReaderRead a timestamp value for the given index.- Specified by:
readTimestampin interfaceResultReader<CallableStatement, String>- Parameters:
cs- 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<CallableStatement, String>- Parameters:
cs- 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<CallableStatement, String>- Parameters:
cs- The result setname- 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<CallableStatement, String>- Parameters:
cs- The result setname- 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<CallableStatement, String>- Parameters:
cs- The result setname- 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<CallableStatement, String>- Parameters:
cs- The result setname- The name (such as the column name)- Returns:
- The string value
-
readInt
Description copied from interface:ResultReaderRead an int value for the given name.- Specified by:
readIntin interfaceResultReader<CallableStatement, String>- Parameters:
cs- The result setname- 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<CallableStatement, String>- Parameters:
cs- The result setname- 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<CallableStatement, String>- Parameters:
cs- The result setname- 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<CallableStatement, String>- Parameters:
cs- The result setname- 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<CallableStatement, String>- Parameters:
cs- The result setname- 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<CallableStatement, String>- Parameters:
cs- The result setname- 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<CallableStatement, String>- Parameters:
cs- The result setname- 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<CallableStatement, String>- Parameters:
cs- The result setname- The name (such as the column name)- Returns:
- The byte[] value
-
getRequiredValue
public <T> @Nullable T getRequiredValue(CallableStatement cs, String name, 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<CallableStatement, String>- Type Parameters:
T- The generic type- Parameters:
cs- The result setname- The nametype- The type- Returns:
- The value
- Throws:
DataAccessException- if the value cannot be read
-