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 Details

    • ColumnIndexResultSetReader

      public ColumnIndexResultSetReader(DataConversionService conversionService)
      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: ResultReader
      Get conversion service.
      Specified by:
      getConversionService in interface ResultReader<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: ResultReader
      Read a value dynamically using the result set and the given name and data type.
      Specified by:
      readDynamic in interface ResultReader<ResultSet,Integer>
      Parameters:
      resultSet - The result set
      index - The name
      dataType - The data type
      Returns:
      The value, can be null
    • readTimestamp

      public Timestamp readTimestamp(ResultSet resultSet, Integer index)
      Description copied from interface: ResultReader
      Read a timestamp value for the given index.
      Specified by:
      readTimestamp in interface ResultReader<ResultSet,Integer>
      Parameters:
      resultSet - The result set
      index - The index (such as the column name)
      Returns:
      The char value
    • readTime

      public Time readTime(ResultSet resultSet, Integer index)
      Description copied from interface: ResultReader
      Read a time value for the given index.
      Specified by:
      readTime in interface ResultReader<ResultSet,Integer>
      Parameters:
      resultSet - The result set
      index - The index (such as the column name)
      Returns:
      The char value
    • readLong

      public long readLong(ResultSet resultSet, Integer index)
      Description copied from interface: ResultReader
      Read a long value for the given name.
      Specified by:
      readLong in interface ResultReader<ResultSet,Integer>
      Parameters:
      resultSet - The result set
      index - The name (such as the column name)
      Returns:
      The long value
    • readChar

      public char readChar(ResultSet resultSet, Integer index)
      Description copied from interface: ResultReader
      Read a char value for the given name.
      Specified by:
      readChar in interface ResultReader<ResultSet,Integer>
      Parameters:
      resultSet - The result set
      index - The name (such as the column name)
      Returns:
      The char value
    • readDate

      public Date readDate(ResultSet resultSet, Integer index)
      Description copied from interface: ResultReader
      Read a date value for the given name.
      Specified by:
      readDate in interface ResultReader<ResultSet,Integer>
      Parameters:
      resultSet - The result set
      index - The name (such as the column name)
      Returns:
      The char value
    • readString

      @Nullable public @Nullable String readString(ResultSet resultSet, Integer index)
      Description copied from interface: ResultReader
      Read a string value for the given name.
      Specified by:
      readString in interface ResultReader<ResultSet,Integer>
      Parameters:
      resultSet - The result set
      index - The name (such as the column name)
      Returns:
      The string value
    • readInt

      public int readInt(ResultSet resultSet, Integer index)
      Description copied from interface: ResultReader
      Read a int value for the given name.
      Specified by:
      readInt in interface ResultReader<ResultSet,Integer>
      Parameters:
      resultSet - The result set
      index - The name (such as the column name)
      Returns:
      The int value
    • readBoolean

      public boolean readBoolean(ResultSet resultSet, Integer index)
      Description copied from interface: ResultReader
      Read a boolean value for the given name.
      Specified by:
      readBoolean in interface ResultReader<ResultSet,Integer>
      Parameters:
      resultSet - The result set
      index - The name (such as the column name)
      Returns:
      The boolean value
    • readFloat

      public float readFloat(ResultSet resultSet, Integer index)
      Description copied from interface: ResultReader
      Read a float value for the given name.
      Specified by:
      readFloat in interface ResultReader<ResultSet,Integer>
      Parameters:
      resultSet - The result set
      index - The name (such as the column name)
      Returns:
      The float value
    • readByte

      public byte readByte(ResultSet resultSet, Integer index)
      Description copied from interface: ResultReader
      Read a byte value for the given name.
      Specified by:
      readByte in interface ResultReader<ResultSet,Integer>
      Parameters:
      resultSet - The result set
      index - The name (such as the column name)
      Returns:
      The byte value
    • readShort

      public short readShort(ResultSet resultSet, Integer index)
      Description copied from interface: ResultReader
      Read a short value for the given name.
      Specified by:
      readShort in interface ResultReader<ResultSet,Integer>
      Parameters:
      resultSet - The result set
      index - The name (such as the column name)
      Returns:
      The short value
    • readDouble

      public double readDouble(ResultSet resultSet, Integer index)
      Description copied from interface: ResultReader
      Read a double value for the given name.
      Specified by:
      readDouble in interface ResultReader<ResultSet,Integer>
      Parameters:
      resultSet - The result set
      index - The name (such as the column name)
      Returns:
      The double value
    • readBigDecimal

      public BigDecimal readBigDecimal(ResultSet resultSet, Integer index)
      Description copied from interface: ResultReader
      Read a BigDecimal value for the given name.
      Specified by:
      readBigDecimal in interface ResultReader<ResultSet,Integer>
      Parameters:
      resultSet - The result set
      index - The name (such as the column name)
      Returns:
      The BigDecimal value
    • readBytes

      public byte[] readBytes(ResultSet resultSet, Integer index)
      Description copied from interface: ResultReader
      Read a byte[] value for the given name.
      Specified by:
      readBytes in interface ResultReader<ResultSet,Integer>
      Parameters:
      resultSet - The result set
      index - 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: ResultReader
      Get a value from the given result set for the given name and type.
      Specified by:
      getRequiredValue in interface ResultReader<ResultSet,Integer>
      Type Parameters:
      T - The generic type
      Parameters:
      resultSet - The result set
      index - The name
      type - The type
      Returns:
      The value
      Throws:
      DataAccessException - if the value cannot be read
    • next

      public boolean next(ResultSet resultSet)
      Description copied from interface: ResultReader
      Move the index to the next result if possible.
      Specified by:
      next in interface ResultReader<ResultSet,Integer>
      Parameters:
      resultSet - The result set
      Returns:
      The next result