Interface Listable<ELEMENT>

Type Parameters:
ELEMENT - the listable element type
All Superinterfaces:
Buildable<Statement<List<ELEMENT>>>, Statement<List<ELEMENT>>
All Known Subinterfaces:
EntityQueryable<ENTITY>, SetOperand<ELEMENT>, SetOperator<ELEMENT>, StreamMappable<ELEMENT>
All Known Implementing Classes:
AbstractSetOperand, EntityqlMultiInsertReturningStatement, EntityqlSelectStarting, EntityqlSelectTerminal, NativeSqlSelectIntermediate, NativeSqlSelectStarting, NativeSqlSetStarting, UnifiedSelectStarting, UnifiedSelectTerminal

public interface Listable<ELEMENT> extends Statement<List<ELEMENT>>
Represents that the implementation can fetch data from database and list them.
  • Method Details

    • fetch

      default List<ELEMENT> fetch()
      Returns data as a list.
      Returns:
      data
    • stream

      default Stream<ELEMENT> stream()
      Returns data as a stream.
      Returns:
      data
    • fetchOptional

      default Optional<ELEMENT> fetchOptional()
      Returns the first element of data as an optional.
      Returns:
      the first element of data
    • fetchOne

      default ELEMENT fetchOne()
      Returns the first element of data.
      Returns:
      the first element of data
    • peek

      Listable<ELEMENT> peek(Consumer<Sql<?>> consumer)
      Description copied from interface: Buildable
      Peeks the built SQL.
      Specified by:
      peek in interface Buildable<ELEMENT>
      Specified by:
      peek in interface Statement<ELEMENT>
      Parameters:
      consumer - the SQL handler
      Returns:
      this instance