Interface SingleQueryable<T>

All Known Subinterfaces:
AsyncQueryable<T>, AsyncSingleQueryable<T>, Queryable<T>
All Known Implementing Classes:
AsyncEntityProjectionQuery, AsyncEntityQuery, AsyncSingleEntityProjectionQuery, AsyncSingleEntityQuery, EntityProjectionQuery, EntityQuery, SingleEntityProjectionQuery, SingleEntityQuery

public interface SingleQueryable<T>
Author:
Collin Alpert
  • Method Summary

    Modifier and Type Method Description
    java.util.Optional<T> first()
    Gets the first value from the database result.
    java.lang.String getQuery()
    Responsible for building and returning the individual DQL statement.
  • Method Details

    • first

      java.util.Optional<T> first()
      Gets the first value from the database result. This method should be used when only one result is expected.
      Returns:
      The first row as an entity wrapped in an Optional if there is at least one row. Otherwise Optional.empty() is returned. If the value from the database is null, an empty Optional is also returned.
    • getQuery

      java.lang.String getQuery()
      Responsible for building and returning the individual DQL statement.
      Returns:
      The DQL statement which fetches data from the database.