E
- Entity typepublic interface QueryResult<E>
Modifier and Type | Method and Description |
---|---|
<X> QueryResult<E> |
changeOrder(javax.persistence.metamodel.SingularAttribute<E,X> attribute)
Revert an existing order attribute sort direction.
|
QueryResult<E> |
changeOrder(String attribute)
Revert an existing order attribute sort direction.
|
QueryResult<E> |
clearOrder()
Remove any ordering from the query result object.
|
long |
count()
Count the result set.
|
int |
countPages()
Count the number of pages.
|
int |
currentPage()
Return the actual page.
|
QueryResult<E> |
firstResult(int first)
Pagination: Set the result start position.
|
QueryResult<E> |
flushMode(javax.persistence.FlushModeType flushMode)
Sets the query flush mode.
|
E |
getAnyResult()
Fetch a single result entity.
|
E |
getOptionalResult()
Fetch a single result entity.
|
List<E> |
getResultList()
Fetch the result set.
|
E |
getSingleResult()
Fetch a single result entity.
|
QueryResult<E> |
hint(String hint,
Object value)
Apply a query hint to the query to execute.
|
QueryResult<E> |
lockMode(javax.persistence.LockModeType lockMode)
Sets the query lock mode.
|
QueryResult<E> |
maxResults(int max)
Limit the number of results returned by the query.
|
QueryResult<E> |
nextPage()
Move to the next page.
|
<X> QueryResult<E> |
orderAsc(javax.persistence.metamodel.SingularAttribute<E,X> attribute)
Sort the query result ascending by the given entity singular attribute.
|
QueryResult<E> |
orderAsc(String attribute)
Sort the query result ascending by the given entity attribute.
|
<X> QueryResult<E> |
orderDesc(javax.persistence.metamodel.SingularAttribute<E,X> attribute)
Sort the query result descending by the given entity singular attribute.
|
QueryResult<E> |
orderDesc(String attribute)
Sort the query result descending by the given entity attribute.
|
int |
pageSize()
Return the actual page size.
|
QueryResult<E> |
previousPage()
Move to the previous page.
|
QueryResult<E> |
toPage(int page)
Move the page cursor to a specific page.
|
QueryResult<E> |
withPageSize(int pageSize)
Set a page size on the query result.
|
<X> QueryResult<E> orderAsc(javax.persistence.metamodel.SingularAttribute<E,X> attribute)
orderAsc(String)
String can be used.attribute
- Sort attribute.QueryResult<E> orderAsc(String attribute)
attribute
- Sort attribute.<X> QueryResult<E> orderDesc(javax.persistence.metamodel.SingularAttribute<E,X> attribute)
orderDesc(String)
String can be used.attribute
- Sort attribute.QueryResult<E> orderDesc(String attribute)
attribute
- Sort attribute.<X> QueryResult<E> changeOrder(javax.persistence.metamodel.SingularAttribute<E,X> attribute)
attribute
- Sort attribute.QueryResult<E> clearOrder()
QueryResult<E> changeOrder(String attribute)
attribute
- Sort attribute.QueryResult<E> maxResults(int max)
max
- Max number of results.QueryResult<E> firstResult(int first)
first
- Result start position.QueryResult<E> lockMode(javax.persistence.LockModeType lockMode)
lockMode
- Query lock mode to use in the query.QueryResult<E> flushMode(javax.persistence.FlushModeType flushMode)
flushMode
- Query flush mode to use in the query.QueryResult<E> hint(String hint, Object value)
hint
- Hint name.value
- Hint value.List<E> getResultList()
E getSingleResult()
E getOptionalResult()
null
if no result is found.null
if no result.E getAnyResult()
null
if no result is found. If the
query finds multiple results, it simply returns the first one found.null
if no result.long count()
QueryResult<E> withPageSize(int pageSize)
maxResults(int)
call.pageSize
- Page size for further queries.QueryResult<E> toPage(int page)
page
- Page to move to for the next query.QueryResult<E> nextPage()
QueryResult<E> previousPage()
int countPages()
int currentPage()
int pageSize()
Copyright © 2015 The Apache Software Foundation. All rights reserved.