Package io.micronaut.data.jdbc.mapper
Class ColumnNameResultSetReader
java.lang.Object
io.micronaut.data.jdbc.mapper.ColumnNameResultSetReader
- All Implemented Interfaces:
- ResultReader<ResultSet,- String> 
public final class ColumnNameResultSetReader
extends Object
implements ResultReader<ResultSet,String> 
A 
ResultReader for JDBC that uses the column name.- Since:
- 1.0.0
- Author:
- graemerocher
- 
Constructor SummaryConstructorsConstructorDescriptionColumnNameResultSetReader(DataConversionService conversionService) Constructs a new instance.
- 
Method SummaryModifier and TypeMethodDescription<T> TconvertRequired(@NonNull Object value, Class<T> type) Convert the value to the given type.io.micronaut.core.convert.ConversionServiceGet conversion service.<T> TgetRequiredValue(ResultSet resultSet, 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(ResultSet resultSet, String name) Read a BigDecimal value for the given name.booleanreadBoolean(ResultSet resultSet, String name) 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, String name) Read a double value for the given name.@Nullable ObjectreadDynamic(@NonNull ResultSet resultSet, @NonNull String 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, String name) Read a string value for the given name.Read a time value for the given index.readTimestamp(ResultSet resultSet, String index) Read a timestamp value for the given index.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.data.runtime.mapper.ResultReaderconvertRequired, readUUID
- 
Constructor Details- 
ColumnNameResultSetReaderpublic ColumnNameResultSetReader()
- 
ColumnNameResultSetReaderConstructs a new instance.- Parameters:
- conversionService- The data conversion service
- Since:
- 3.1
 
 
- 
- 
Method Details- 
getConversionServicepublic io.micronaut.core.convert.ConversionService getConversionService()Description copied from interface:ResultReaderGet conversion service.- Specified by:
- getConversionServicein interface- ResultReader<ResultSet,- String> 
- Returns:
- the instance of ConversionService
 
- 
readDynamic@Nullable public @Nullable Object readDynamic(@NonNull @NonNull ResultSet resultSet, @NonNull @NonNull String 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 interface- ResultReader<ResultSet,- String> 
- Parameters:
- resultSet- The result set
- index- The name
- dataType- The data type
- Returns:
- The value, can be null
 
- 
nextDescription copied from interface:ResultReaderMove the index to the next result if possible.- Specified by:
- nextin interface- ResultReader<ResultSet,- String> 
- Parameters:
- resultSet- The result set
- Returns:
- The next result
 
- 
convertRequiredDescription copied from interface:ResultReaderConvert the value to the given type.- Specified by:
- convertRequiredin interface- ResultReader<ResultSet,- String> 
- Type Parameters:
- T- The generic type
- Parameters:
- value- The value
- type- The type
- Returns:
- The converted value
 
- 
readTimestampDescription copied from interface:ResultReaderRead a timestamp value for the given index.- Specified by:
- readTimestampin interface- ResultReader<ResultSet,- String> 
- Parameters:
- resultSet- The result set
- index- The index (such as the column name)
- Returns:
- The char value
 
- 
readTimeDescription copied from interface:ResultReaderRead a time value for the given index.- Specified by:
- readTimein interface- ResultReader<ResultSet,- String> 
- Parameters:
- resultSet- The result set
- index- The index (such as the column name)
- Returns:
- The char value
 
- 
readLongDescription copied from interface:ResultReaderRead a long value for the given name.- Specified by:
- readLongin interface- ResultReader<ResultSet,- String> 
- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The long value
 
- 
readCharDescription copied from interface:ResultReaderRead a char value for the given name.- Specified by:
- readCharin interface- ResultReader<ResultSet,- String> 
- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The char value
 
- 
readDateDescription copied from interface:ResultReaderRead a date value for the given name.- Specified by:
- readDatein interface- ResultReader<ResultSet,- String> 
- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The char value
 
- 
readStringDescription copied from interface:ResultReaderRead a string value for the given name.- Specified by:
- readStringin interface- ResultReader<ResultSet,- String> 
- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The string value
 
- 
readIntDescription copied from interface:ResultReaderRead a int value for the given name.- Specified by:
- readIntin interface- ResultReader<ResultSet,- String> 
- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The int value
 
- 
readBooleanDescription copied from interface:ResultReaderRead a boolean value for the given name.- Specified by:
- readBooleanin interface- ResultReader<ResultSet,- String> 
- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The boolean value
 
- 
readFloatDescription copied from interface:ResultReaderRead a float value for the given name.- Specified by:
- readFloatin interface- ResultReader<ResultSet,- String> 
- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The float value
 
- 
readByteDescription copied from interface:ResultReaderRead a byte value for the given name.- Specified by:
- readBytein interface- ResultReader<ResultSet,- String> 
- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The byte value
 
- 
readShortDescription copied from interface:ResultReaderRead a short value for the given name.- Specified by:
- readShortin interface- ResultReader<ResultSet,- String> 
- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The short value
 
- 
readDoubleDescription copied from interface:ResultReaderRead a double value for the given name.- Specified by:
- readDoublein interface- ResultReader<ResultSet,- String> 
- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The double value
 
- 
readBigDecimalDescription copied from interface:ResultReaderRead a BigDecimal value for the given name.- Specified by:
- readBigDecimalin interface- ResultReader<ResultSet,- String> 
- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The BigDecimal value
 
- 
readBytesDescription copied from interface:ResultReaderRead a byte[] value for the given name.- Specified by:
- readBytesin interface- ResultReader<ResultSet,- String> 
- Parameters:
- resultSet- The result set
- name- The name (such as the column name)
- Returns:
- The byte[] value
 
- 
getRequiredValuepublic <T> T getRequiredValue(ResultSet resultSet, 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 interface- ResultReader<ResultSet,- String> 
- 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
 
 
-