public interface SearchQuery<T>
| Modifier and Type | Method and Description |
|---|---|
default SearchResult<T> |
fetch()
Execute the query and return the
SearchResult. |
default SearchResult<T> |
fetch(Integer limit)
Execute the query and return the
SearchResult. |
default SearchResult<T> |
fetch(Integer limit,
Integer offset)
Execute the query and return the
SearchResult. |
default SearchResult<T> |
fetch(Long limit)
Execute the query and return the
SearchResult. |
SearchResult<T> |
fetch(Long limit,
Long offset)
Execute the query and return the
SearchResult. |
default List<T> |
fetchHits()
Execute the query and return the hits as a
List. |
default List<T> |
fetchHits(Integer limit)
Execute the query and return the hits as a
List. |
default List<T> |
fetchHits(Integer limit,
Integer offset)
Execute the query and return the hits as a
List. |
default List<T> |
fetchHits(Long limit)
Execute the query and return the hits as a
List. |
List<T> |
fetchHits(Long limit,
Long offset)
Execute the query and return the hits as a
List. |
Optional<T> |
fetchSingleHit()
Execute the query and return the hits as a single, optional element.
|
long |
fetchTotalHitCount()
Execute the query and return the total hit count.
|
SearchQuery<T> |
setFetchSize(int fetchSize)
Set the JDBC fetch size for this query.
|
TypedQuery<T> |
toJpaQuery()
Convert this query to a
JPA query. |
Query<T> |
toOrmQuery()
Convert this query to a
Hibernate ORM query. |
default SearchResult<T> fetch()
SearchResult.SearchResult.SearchException - If something goes wrong while executing the query.HibernateException - If something goes wrong while fetching entities from the database.PersistenceException - If something goes wrong while fetching entities from the database.default SearchResult<T> fetch(Long limit)
SearchResult.limit - The maximum number of hits to be included in the SearchResult. null means no limit.SearchResult.SearchException - If something goes wrong while executing the query.HibernateException - If something goes wrong while fetching entities from the database.PersistenceException - If something goes wrong while fetching entities from the database.default SearchResult<T> fetch(Integer limit)
SearchResult.limit - The maximum number of hits to be included in the SearchResult. null means no limit.SearchResult.SearchException - If something goes wrong while executing the query.HibernateException - If something goes wrong while fetching entities from the database.PersistenceException - If something goes wrong while fetching entities from the database.SearchResult<T> fetch(Long limit, Long offset)
SearchResult.limit - The maximum number of hits to be included in the SearchResult. null means no limit.offset - The number of hits to skip before adding the hits to the SearchResult. null means no offset.SearchResult.SearchException - If something goes wrong while executing the query.HibernateException - If something goes wrong while fetching entities from the database.PersistenceException - If something goes wrong while fetching entities from the database.default SearchResult<T> fetch(Integer limit, Integer offset)
SearchResult.limit - The maximum number of hits to be included in the SearchResult. null means no limit.offset - The number of hits to skip before adding the hits to the SearchResult. null means no offset.SearchResult.SearchException - If something goes wrong while executing the query.HibernateException - If something goes wrong while fetching entities from the database.PersistenceException - If something goes wrong while fetching entities from the database.default List<T> fetchHits()
List.SearchException - If something goes wrong while executing the query.HibernateException - If something goes wrong while fetching entities from the database.PersistenceException - If something goes wrong while fetching entities from the database.default List<T> fetchHits(Long limit)
List.limit - The maximum number of hits to be returned by this method. null means no limit.SearchException - If something goes wrong while executing the query.HibernateException - If something goes wrong while fetching entities from the database.PersistenceException - If something goes wrong while fetching entities from the database.default List<T> fetchHits(Integer limit)
List.limit - The maximum number of hits to be returned by this method. null means no limit.SearchException - If something goes wrong while executing the query.HibernateException - If something goes wrong while fetching entities from the database.PersistenceException - If something goes wrong while fetching entities from the database.List<T> fetchHits(Long limit, Long offset)
List.limit - The maximum number of hits to be returned by this method. null means no limit.offset - The number of hits to skip. null means no offset. null means no offset.SearchException - If something goes wrong while executing the query.HibernateException - If something goes wrong while fetching entities from the database.PersistenceException - If something goes wrong while fetching entities from the database.default List<T> fetchHits(Integer limit, Integer offset)
List.limit - The maximum number of hits to be returned by this method. null means no limit.offset - The number of hits to skip. null means no offset. null means no offset.SearchException - If something goes wrong while executing the query.HibernateException - If something goes wrong while fetching entities from the database.PersistenceException - If something goes wrong while fetching entities from the database.Optional<T> fetchSingleHit()
SearchException - If something goes wrong while executing the query,
or the number of hits is more than one.HibernateException - If something goes wrong while fetching entities from the database.PersistenceException - If something goes wrong while fetching entities from the database.long fetchTotalHitCount()
SearchException - If something goes wrong while executing the query.SearchQuery<T> setFetchSize(int fetchSize)
fetchSize - The fetch size. Must be positive or zero.this for method chaining.Query.setFetchSize(int)TypedQuery<T> toJpaQuery()
JPA query.
Note that the resulting query does not support all operations and may behave slightly differently in some cases (including, but not limited to, the type of thrown exceptions). For these reasons, it is recommended to only use this method when integrating to an external library that expects JPA queries.
Query<T> toOrmQuery()
Hibernate ORM query.
Note that the resulting query does not support all operations and may behave slightly differently in some cases (including, but not limited to, the type of thrown exceptions). For these reasons, it is recommended to only use this method when integrating to an external library that expects Hibernate ORM queries.
Copyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.