public interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity> extends TopiaQueryBuilderRunQueryWithUniqueResultStep<E>
TopiaQueryBuilderAddCriteriaStep)
There are different methods according to the supposed existence or uniqueness of the result. Also some methods may be
used only if order is defined in query.
Some methods return an Optional, but since it's not yet available in JDK, we use Guava's. If you don't want
your project to require Guava dependency, we provide equivalent method named XXXOrNull() for the same purpose.| Modifier and Type | Method and Description |
|---|---|
long |
count()
This method is equivalent as calling
Collection.size() after doing a findAll() but it
may be faster. |
List<E> |
find(int startIndex,
int endIndex)
Get the elements with the given bounds.
|
List<E> |
find(org.nuiton.util.pagination.PaginationParameter page)
Get the elements according to the given
PaginationParameter. |
List<E> |
findAll()
Get all the elements of the result set.
|
List<String> |
findAllIds()
Get all the elements identifiers of the result set.
|
Iterable<E> |
findAllLazy()
Get all the elements in a lazy loading list.
|
Iterable<E> |
findAllLazy(int batchSize)
Get all the elements in a lazy loading list.
|
E |
findAny()
Get the an element of the non-empty result set.
|
E |
findAnyOrNull()
Get the an element of the result set or null if query result is empty.
|
E |
findFirst()
Get the first element of the non-empty result set.
|
E |
findFirstOrNull()
Get the first element of the result set or null if query result is empty.
|
List<String> |
findIds(int startIndex,
int endIndex)
Get the elements identifiers with the given bounds.
|
List<String> |
findIds(org.nuiton.util.pagination.PaginationParameter page)
Get the elements identifiers according to the given
PaginationParameter. |
org.nuiton.util.pagination.PaginationResult<String> |
findIdsPage(org.nuiton.util.pagination.PaginationParameter page)
Get the elements identifiers according to the given
PaginationParameter. |
org.nuiton.util.pagination.PaginationResult<E> |
findPage(org.nuiton.util.pagination.PaginationParameter page)
Get the elements according to the given
PaginationParameter. |
Stream<E> |
stream()
Like
findAll() but getting a stream that may lazily fetch data. |
com.google.common.base.Optional<E> |
tryFindAny()
Get the an element of the result set.
|
com.google.common.base.Optional<E> |
tryFindFirst()
Get the first element of the result set.
|
exists, findUnique, findUniqueOrNull, tryFindUniquelong count()
Collection.size() after doing a findAll() but it
may be faster.E findFirst() throws QueryMissingOrderException, TopiaNoResultException
QueryMissingOrderException - if you the query misses an order clauseTopiaNoResultException - if the query does not return any resultE findFirstOrNull() throws QueryMissingOrderException
tryFindFirst() but allows you to prevent using Guava in you project.QueryMissingOrderException - if you the query misses an order clausecom.google.common.base.Optional<E> tryFindFirst() throws QueryMissingOrderException
findFirst()QueryMissingOrderException - if you the query misses an order clauseE findAny() throws TopiaNoResultException
TopiaNoResultException - if the query does not return any resultE findAnyOrNull()
tryFindAny() but allows you to prevent using Guava in you project.com.google.common.base.Optional<E> tryFindAny()
findAny()List<E> findAll()
Stream<E> stream()
findAll() but getting a stream that may lazily fetch data.
Actual behavior rely on implementation.
Caller should BaseStream.close() the stream.Iterable<E> findAllLazy()
findAllLazy(int)Iterable<E> findAllLazy(int batchSize)
findAllLazy()batchSize - the number of elements to load per requestList<E> find(int startIndex, int endIndex)
startIndex - inclusive index of the first element to return. This value is 0-basedendIndex - inclusive index of the last element to return. A value lower than 0 means infinite upper bound.List<E> find(org.nuiton.util.pagination.PaginationParameter page)
PaginationParameter.
Use findPage(PaginationParameter) to get a PaginationResult instead of a list.page - information about the page to load.PaginationParameterorg.nuiton.util.pagination.PaginationResult<E> findPage(org.nuiton.util.pagination.PaginationParameter page)
PaginationParameter.
Use find(PaginationParameter) to get a list instead of PaginationResult.
Note: compared to find(PaginationParameter), this method performs an additional statement to get the
total elements count.page - information about the page to load.PaginationParameter,
PaginationResultList<String> findAllIds()
findAll(), this method will not load entities, only its identifier.List<String> findIds(int startIndex, int endIndex)
find(int, int), this method will not load entities, only its identifier.startIndex - inclusive index of the first element to return. This value is 0-basedendIndex - inclusive index of the last element to return. A value lower than 0 means infinite upper bound.List<String> findIds(org.nuiton.util.pagination.PaginationParameter page)
PaginationParameter.
Use findIdsPage(PaginationParameter) to get a PaginationResult instead of a list.
Note: compared to find(PaginationParameter), this method will not load entities, only its identifier.page - information about the page to load.PaginationParameterorg.nuiton.util.pagination.PaginationResult<String> findIdsPage(org.nuiton.util.pagination.PaginationParameter page)
PaginationParameter.
Use findIds(PaginationParameter) to get a list instead of PaginationResult.
Note: compared to findIds(PaginationParameter), this method performs an additional statement to get the
total elements identifiers count.
Note: compared to findPage(PaginationParameter), this method will not load entities, only its identifierpage - information about the page to load.PaginationParameter,
PaginationResultCopyright © 2004–2019 CodeLutin. All rights reserved.