Package com.blazebit.persistence
Interface Queryable<T,X extends Queryable<T,X>>
- Type Parameters:
T
- The query result typeX
- The concrete builder type
- All Known Subinterfaces:
CriteriaBuilder<T>
,FinalSetOperationCriteriaBuilder<T>
,FullQueryBuilder<T,
,X> PaginatedCriteriaBuilder<T>
,QueryBuilder<T,
X>
public interface Queryable<T,X extends Queryable<T,X>>
A base interface for builders that querying.
- Since:
- 1.1.0
- Author:
- Christian Beikov
-
Method Summary
Modifier and TypeMethodDescriptionjavax.persistence.TypedQuery<T>
getQuery()
Returns the JPA typed query for the built query.Returns the query string for the built query.Execute the query and return the result as a type List.java.util.stream.Stream<T>
Execute the query and return the result as a type Stream.Execute the query expecting a single result.
-
Method Details
-
getQueryString
String getQueryString()Returns the query string for the built query.- Returns:
- The query string
-
getQuery
javax.persistence.TypedQuery<T> getQuery()Returns the JPA typed query for the built query. The returned query is already parameterized with all known parameters.- Returns:
- The typed query for the built query
-
getResultList
Execute the query and return the result as a type List.- Returns:
- The list of the results
-
getSingleResult
T getSingleResult()Execute the query expecting a single result.- Returns:
- The single result
-
getResultStream
java.util.stream.Stream<T> getResultStream()Execute the query and return the result as a type Stream.- Returns:
- The stream of the results
-