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 Type Method Description javax.persistence.TypedQuery<T>
getQuery()
Returns the JPA typed query for the built query.String
getQueryString()
Returns the query string for the built query.List<T>
getResultList()
Execute the query and return the result as a type List.T
getSingleResult()
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
-