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 Detail
-
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
Optionalif there is at least one row. OtherwiseOptional.empty()is returned. If the value from the database isnull, an emptyOptionalis 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.
-
-