Interface ResultConsumer.Context<RS>

Type Parameters:
RS - The result set type.
Enclosing interface:
ResultConsumer<T,RS>

public static interface ResultConsumer.Context<RS>
A context object that simplifies mapping results to objects.
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
    default @Nullable BigDecimal
    readBigDecimal(@NonNull String name)
    Read a BigDecimal value for the given name.
    default boolean
    readBoolean(@NonNull String name)
    Read a boolean value for the given name.
    default byte
    readByte(@NonNull String name)
    Read a byte value for the given name.
    default byte[]
    readBytes(@NonNull String name)
    Read a byte[] value for the given name.
    default char
    readChar(@NonNull String name)
    Read a char value for the given name.
    default @Nullable Date
    readDate(@NonNull String name)
    Read a date value for the given name.
    default double
    readDouble(@NonNull String name)
    Read a double value for the given name.
    <E, D> D
    readDTO(@NonNull String prefix, @NonNull Class<E> rootEntity, @NonNull Class<D> dtoType)
    Read an entity using the given prefix to be passes to result set lookups.
    <E> E
    readEntity(@NonNull String prefix, @NonNull Class<E> type)
    Read an entity using the given prefix to be passes to result set lookups.
    default float
    readFloat(@NonNull String name)
    Read a float value for the given name.
    default int
    readInt(@NonNull String name)
    Read a int value for the given name.
    default long
    readLong(@NonNull String name)
    Read a long value for the given name.
    default short
    readShort(@NonNull String name)
    Read a short value for the given name.
    default @Nullable String
    readString(@NonNull String name)
    Read a string value for the given name.
    default @Nullable Date
    readTimestamp(@NonNull String name)
    Read a timestamp value for the given index.
  • Method Details

    • getResultSet

      RS getResultSet()
      Returns:
      The current state of the result.
    • getResultReader

      ResultReader<RS,String> getResultReader()
      Returns:
      The result reader.
    • readEntity

      @NonNull <E> E readEntity(@NonNull @NonNull String prefix, @NonNull @NonNull Class<E> type) throws DataAccessException
      Read an entity using the given prefix to be passes to result set lookups.
      Type Parameters:
      E - The entity generic type
      Parameters:
      prefix - The prefix
      type - The entity type
      Returns:
      The entity result
      Throws:
      DataAccessException - if it is not possible read the result from the result set.
    • readDTO

      @NonNull <E, D> D readDTO(@NonNull @NonNull String prefix, @NonNull @NonNull Class<E> rootEntity, @NonNull @NonNull Class<D> dtoType) throws DataAccessException
      Read an entity using the given prefix to be passes to result set lookups.
      Type Parameters:
      E - The entity generic type
      D - The DTO generic type
      Parameters:
      prefix - The prefix
      rootEntity - The entity type
      dtoType - The DTO type. Must be annotated with Introspected
      Returns:
      The entity result
      Throws:
      DataAccessException - if it is not possible read the result from the result set.
    • readLong

      default long readLong(@NonNull @NonNull String name)
      Read a long value for the given name.
      Parameters:
      name - The name (such as the column name)
      Returns:
      The long value
    • readChar

      default char readChar(@NonNull @NonNull String name)
      Read a char value for the given name.
      Parameters:
      name - The name (such as the column name)
      Returns:
      The char value
    • readDate

      @Nullable default @Nullable Date readDate(@NonNull @NonNull String name)
      Read a date value for the given name.
      Parameters:
      name - The name (such as the column name)
      Returns:
      The char value
    • readTimestamp

      @Nullable default @Nullable Date readTimestamp(@NonNull @NonNull String name)
      Read a timestamp value for the given index.
      Parameters:
      name - The name (such as the column name)
      Returns:
      The char value
    • readString

      @Nullable default @Nullable String readString(@NonNull @NonNull String name)
      Read a string value for the given name.
      Parameters:
      name - The name (such as the column name)
      Returns:
      The string value
    • readInt

      default int readInt(@NonNull @NonNull String name)
      Read a int value for the given name.
      Parameters:
      name - The name (such as the column name)
      Returns:
      The int value
    • readBoolean

      default boolean readBoolean(@NonNull @NonNull String name)
      Read a boolean value for the given name.
      Parameters:
      name - The name (such as the column name)
      Returns:
      The boolean value
    • readFloat

      default float readFloat(@NonNull @NonNull String name)
      Read a float value for the given name.
      Parameters:
      name - The name (such as the column name)
      Returns:
      The float value
    • readByte

      default byte readByte(@NonNull @NonNull String name)
      Read a byte value for the given name.
      Parameters:
      name - The name (such as the column name)
      Returns:
      The byte value
    • readShort

      default short readShort(@NonNull @NonNull String name)
      Read a short value for the given name.
      Parameters:
      name - The name (such as the column name)
      Returns:
      The short value
    • readDouble

      default double readDouble(@NonNull @NonNull String name)
      Read a double value for the given name.
      Parameters:
      name - The name (such as the column name)
      Returns:
      The double value
    • readBigDecimal

      @Nullable default @Nullable BigDecimal readBigDecimal(@NonNull @NonNull String name)
      Read a BigDecimal value for the given name.
      Parameters:
      name - The name (such as the column name)
      Returns:
      The BigDecimal value
    • readBytes

      default byte[] readBytes(@NonNull @NonNull String name)
      Read a byte[] value for the given name.
      Parameters:
      name - The name (such as the column name)
      Returns:
      The byte[] value