public static class AbstractTopiaDao.InnerTopiaQueryBuilderRunQueryStep<E extends TopiaEntity> extends Object implements TopiaQueryBuilderRunQueryStep<E>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
fromHql |
protected String |
hql |
protected String |
hqlForFetchStep1 |
protected String |
hqlForFetchStep2 |
protected Map<String,Object> |
hqlParameters |
protected AbstractTopiaDao<E> |
topiaDao |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTopiaDao.InnerTopiaQueryBuilderRunQueryStep(AbstractTopiaDao<E> topiaDao,
boolean fromHql,
String hql,
Map<String,Object> hqlParameters) |
protected |
AbstractTopiaDao.InnerTopiaQueryBuilderRunQueryStep(AbstractTopiaDao<E> topiaDao,
boolean fromHql,
String hql,
Map<String,Object> hqlParameters,
String hqlForFetchStep1,
String hqlForFetchStep2) |
| Modifier and Type | Method and Description |
|---|---|
long |
count()
This method is equivalent as calling
Collection.size() after doing a TopiaQueryBuilderRunQueryStep.findAll() but it
may be faster. |
boolean |
exists() |
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. |
E |
findUnique()
Get the first element of a single-element result set.
|
E |
findUniqueOrNull()
Get the first element of a single-element result set or null if query result is empty.
|
protected <O extends TopiaEntity> |
sortAccordingToIds(List<O> entities,
List<String> idsList)
This method can be used when it is not possible to sort entities in SQL/HQL.
|
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.
|
com.google.common.base.Optional<E> |
tryFindUnique()
Get the first element of a single-element result set.
|
protected final String hql
protected final AbstractTopiaDao<E extends TopiaEntity> topiaDao
protected final boolean fromHql
protected final String hqlForFetchStep1
protected final String hqlForFetchStep2
protected AbstractTopiaDao.InnerTopiaQueryBuilderRunQueryStep(AbstractTopiaDao<E> topiaDao, boolean fromHql, String hql, Map<String,Object> hqlParameters)
public boolean exists()
exists in interface TopiaQueryBuilderRunQueryWithUniqueResultStep<E extends TopiaEntity>public long count()
TopiaQueryBuilderRunQueryStepCollection.size() after doing a TopiaQueryBuilderRunQueryStep.findAll() but it
may be faster.count in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>public E findUnique() throws TopiaNoResultException, TopiaNonUniqueResultException
TopiaQueryBuilderRunQueryWithUniqueResultStepfindUnique in interface TopiaQueryBuilderRunQueryWithUniqueResultStep<E extends TopiaEntity>TopiaNoResultException - if the query does not return any result.TopiaNonUniqueResultException - if the query returns more than one element.public E findUniqueOrNull() throws TopiaNonUniqueResultException
TopiaQueryBuilderRunQueryWithUniqueResultStepTopiaQueryBuilderRunQueryWithUniqueResultStep.tryFindUnique() but allows you to prevent using Guava in you project.findUniqueOrNull in interface TopiaQueryBuilderRunQueryWithUniqueResultStep<E extends TopiaEntity>TopiaNonUniqueResultException - if the query returns more than one element.public com.google.common.base.Optional<E> tryFindUnique() throws TopiaNonUniqueResultException
TopiaQueryBuilderRunQueryWithUniqueResultStepTopiaQueryBuilderRunQueryWithUniqueResultStep.findUnique()tryFindUnique in interface TopiaQueryBuilderRunQueryWithUniqueResultStep<E extends TopiaEntity>TopiaNonUniqueResultException - if the query returns more than one element.public E findFirst() throws QueryMissingOrderException, TopiaNoResultException
TopiaQueryBuilderRunQueryStepfindFirst in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>QueryMissingOrderException - if you the query misses an order clauseTopiaNoResultException - if the query does not return any resultpublic E findFirstOrNull() throws QueryMissingOrderException
TopiaQueryBuilderRunQueryStepTopiaQueryBuilderRunQueryStep.tryFindFirst() but allows you to prevent using Guava in you project.findFirstOrNull in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>QueryMissingOrderException - if you the query misses an order clausepublic com.google.common.base.Optional<E> tryFindFirst() throws QueryMissingOrderException
TopiaQueryBuilderRunQueryStepTopiaQueryBuilderRunQueryStep.findFirst()tryFindFirst in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>QueryMissingOrderException - if you the query misses an order clausepublic E findAny() throws TopiaNoResultException
TopiaQueryBuilderRunQueryStepfindAny in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>TopiaNoResultException - if the query does not return any resultpublic E findAnyOrNull()
TopiaQueryBuilderRunQueryStepTopiaQueryBuilderRunQueryStep.tryFindAny() but allows you to prevent using Guava in you project.findAnyOrNull in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>public com.google.common.base.Optional<E> tryFindAny()
TopiaQueryBuilderRunQueryStepTopiaQueryBuilderRunQueryStep.findAny()tryFindAny in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>public List<E> findAll()
TopiaQueryBuilderRunQueryStepfindAll in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>public Iterable<E> findAllLazy()
TopiaQueryBuilderRunQueryStepTopiaQueryBuilderRunQueryStep.findAllLazy(int)findAllLazy in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>public Iterable<E> findAllLazy(int batchSize)
TopiaQueryBuilderRunQueryStepTopiaQueryBuilderRunQueryStep.findAllLazy()findAllLazy in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>batchSize - the number of elements to load per requestpublic List<E> find(int startIndex, int endIndex)
TopiaQueryBuilderRunQueryStepfind in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>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.public List<E> find(org.nuiton.util.pagination.PaginationParameter page)
TopiaQueryBuilderRunQueryStepPaginationParameter.
Use TopiaQueryBuilderRunQueryStep.findPage(PaginationParameter) to get a PaginationResult instead of a list.find in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>page - information about the page to load.PaginationParameterpublic org.nuiton.util.pagination.PaginationResult<E> findPage(org.nuiton.util.pagination.PaginationParameter page)
TopiaQueryBuilderRunQueryStepPaginationParameter.
Use TopiaQueryBuilderRunQueryStep.find(PaginationParameter) to get a list instead of PaginationResult.
Note: compared to TopiaQueryBuilderRunQueryStep.find(PaginationParameter), this method performs an additional statement to get the
total elements count.findPage in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>page - information about the page to load.PaginationParameter,
PaginationResultprotected <O extends TopiaEntity> List<O> sortAccordingToIds(List<O> entities, List<String> idsList)
O - must be a TopiaEntityentities - the list en entities (unsorted)idsList - the list of ids (sorted)public List<String> findAllIds()
TopiaQueryBuilderRunQueryStepTopiaQueryBuilderRunQueryStep.findAll(), this method will not load entities, only its identifier.findAllIds in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>public List<String> findIds(int startIndex, int endIndex)
TopiaQueryBuilderRunQueryStepTopiaQueryBuilderRunQueryStep.find(int, int), this method will not load entities, only its identifier.findIds in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>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.public List<String> findIds(org.nuiton.util.pagination.PaginationParameter page)
TopiaQueryBuilderRunQueryStepPaginationParameter.
Use TopiaQueryBuilderRunQueryStep.findIdsPage(PaginationParameter) to get a PaginationResult instead of a list.
Note: compared to TopiaQueryBuilderRunQueryStep.find(PaginationParameter), this method will not load entities, only its identifier.findIds in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>page - information about the page to load.PaginationParameterpublic org.nuiton.util.pagination.PaginationResult<String> findIdsPage(org.nuiton.util.pagination.PaginationParameter page)
TopiaQueryBuilderRunQueryStepPaginationParameter.
Use TopiaQueryBuilderRunQueryStep.findIds(PaginationParameter) to get a list instead of PaginationResult.
Note: compared to TopiaQueryBuilderRunQueryStep.findIds(PaginationParameter), this method performs an additional statement to get the
total elements identifiers count.
Note: compared to TopiaQueryBuilderRunQueryStep.findPage(PaginationParameter), this method will not load entities, only its identifierfindIdsPage in interface TopiaQueryBuilderRunQueryStep<E extends TopiaEntity>page - information about the page to load.PaginationParameter,
PaginationResultCopyright © 2004–2014 CodeLutin. All rights reserved.