Interface JdbcClient.MappedQuerySpec<T>

Type Parameters:
T - the RowMapper-declared result type
Enclosing interface:
JdbcClient

public static interface JdbcClient.MappedQuerySpec<T>
A specification for RowMapper-mapped queries.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieve the result as a pre-resolved list of mapped objects, retaining the order from the original database result.
    default Optional<T>
    Retrieve a single result, if available, as an Optional handle.
    default Set<T>
    set()
    Retrieve the result as an order-preserving set of mapped objects.
    default T
    Retrieve a single result as a required object instance.
    Retrieve the result as a lazily resolved stream of mapped objects, retaining the order from the original database result.
  • Method Details

    • stream

      Stream<T> stream()
      Retrieve the result as a lazily resolved stream of mapped objects, retaining the order from the original database result.
      Returns:
      the result Stream, containing mapped objects, needing to be closed once fully processed (e.g. through a try-with-resources clause)
    • list

      List<T> list()
      Retrieve the result as a pre-resolved list of mapped objects, retaining the order from the original database result.
      Returns:
      the result as a detached List, containing mapped objects
    • set

      default Set<T> set()
      Retrieve the result as an order-preserving set of mapped objects.
      Returns:
      the result as a detached Set, containing mapped objects
      See Also:
    • optional

      default Optional<T> optional()
      Retrieve a single result, if available, as an Optional handle.
      Returns:
      an Optional handle with a single result object or none
      See Also:
    • single

      default T single()
      Retrieve a single result as a required object instance.
      Returns:
      the single result object (never null)
      See Also: