Interface SingleQueryable<T>

    • Method Summary

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

      • first

        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

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