Class AbstractTopiaDao.InnerTopiaQueryBuilderAddCriteriaOrRunQueryStep<E extends TopiaEntity>
java.lang.Object
org.nuiton.topia.persistence.internal.AbstractTopiaDao.InnerTopiaQueryBuilderAddCriteriaOrRunQueryStep<E>
- All Implemented Interfaces:
TopiaQueryBuilderAddCriteriaOrRunQueryStep<E>,TopiaQueryBuilderAddCriteriaStep<E>,TopiaQueryBuilderRunQueryStep<E>,TopiaQueryBuilderRunQueryWithUniqueResultStep<E>
- Enclosing class:
- AbstractTopiaDao<E extends TopiaEntity>
public static class AbstractTopiaDao.InnerTopiaQueryBuilderAddCriteriaOrRunQueryStep<E extends TopiaEntity>
extends Object
implements TopiaQueryBuilderAddCriteriaOrRunQueryStep<E>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HqlAndParametersBuilder<E>protected AbstractTopiaDao<E> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInnerTopiaQueryBuilderAddCriteriaOrRunQueryStep(AbstractTopiaDao<E> topiaDao, HqlAndParametersBuilder<E> hqlAndParametersBuilder) -
Method Summary
Modifier and TypeMethodDescriptionaddAllFetches(String property, String... otherProperties) addAllFetches(Collection<String> properties) addContains(String property, Object value) addIn(String property, Collection<?> values) addNotContains(String property, Object value) addNotEquals(String property, Object value) addNotIn(String property, Collection<?> values) addNotNull(String property) addTopiaIdEquals(String property, String topiaId) This method has the same behavior asTopiaQueryBuilderAddCriteriaStep.addEquals(String, Object)but you don't need to have the entity but only the topiaId.addTopiaIdIn(String property, Collection<String> topiaIds) This method has the same behavior asTopiaQueryBuilderAddCriteriaStep.addIn(String, Collection)but you don't need to have the entity but only the topiaId.addTopiaIdNotEquals(String property, String topiaId) This method has the same behavior asTopiaQueryBuilderAddCriteriaStep.addNotEquals(String, Object)but you don't need to have the entity but only the topiaId.addTopiaIdNotIn(String property, Collection<String> topiaIds) This method has the same behavior asTopiaQueryBuilderAddCriteriaStep.addNotIn(String, Collection)but you don't need to have the entity but only the topiaId.longcount()This method is equivalent as callingCollection.size()after doing aTopiaQueryBuilderRunQueryStep.findAll()but it may be faster.booleanexists()find(int startIndex, int endIndex) Get the elements with the given bounds.find(org.nuiton.util.pagination.PaginationParameter page) Get the elements according to the givenPaginationParameter.findAll()Get all the elements of the result set.Get all the elements identifiers of the result set.Get all the elements in a lazy loading list.findAllLazy(int batchSize) Get all the elements in a lazy loading list.findAny()Get the an element of the non-empty result set.Get the an element of the result set or null if query result is empty.Get the first element of the non-empty result set.Get the first element of the result set or null if query result is empty.findIds(int startIndex, int endIndex) Get the elements identifiers with the given bounds.findIds(org.nuiton.util.pagination.PaginationParameter page) Get the elements identifiers according to the givenPaginationParameter.org.nuiton.util.pagination.PaginationResult<String>findIdsPage(org.nuiton.util.pagination.PaginationParameter page) Get the elements identifiers according to the givenPaginationParameter.org.nuiton.util.pagination.PaginationResult<E>findPage(org.nuiton.util.pagination.PaginationParameter page) Get the elements according to the givenPaginationParameter.Get the first element of a single-element result set.Get the first element of a single-element result set or null if query result is empty.setOrderByArguments(String... orderByArguments) setOrderByArguments(Collection<org.nuiton.util.pagination.PaginationOrder> paginationOrders) setOrderByArguments(LinkedHashSet<String> orderByArguments) stream()LikeTopiaQueryBuilderRunQueryStep.findAll()but getting a stream that may lazily fetch data.com.google.common.base.Optional<E>Get the an element of the result set.com.google.common.base.Optional<E>Get the first element of the result set.com.google.common.base.Optional<E>Get the first element of a single-element result set.
-
Field Details
-
topiaDao
-
hqlAndParametersBuilder
-
-
Constructor Details
-
InnerTopiaQueryBuilderAddCriteriaOrRunQueryStep
protected InnerTopiaQueryBuilderAddCriteriaOrRunQueryStep(AbstractTopiaDao<E> topiaDao, HqlAndParametersBuilder<E> hqlAndParametersBuilder)
-
-
Method Details
-
setOrderByArguments
public AbstractTopiaDao.InnerTopiaQueryBuilderRunQueryStep<E> setOrderByArguments(LinkedHashSet<String> orderByArguments) - Specified by:
setOrderByArgumentsin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
orderByArguments- list of arguments that will be added as order by- Returns:
- the next step as this method must be used at the end
-
setOrderByArguments
public AbstractTopiaDao.InnerTopiaQueryBuilderRunQueryStep<E> setOrderByArguments(String... orderByArguments) - Specified by:
setOrderByArgumentsin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
orderByArguments- list of arguments that will be added as order by- Returns:
- the next step as this method must be used at the end
-
setOrderByArguments
public TopiaQueryBuilderRunQueryStep<E> setOrderByArguments(Collection<org.nuiton.util.pagination.PaginationOrder> paginationOrders) - Specified by:
setOrderByArgumentsin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
paginationOrders- list ofPaginationOrderthat will be added as order by- Returns:
- the next step as this method must be used at the end
- See Also:
-
PaginationOrder
-
addEquals
- Specified by:
addEqualsin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
property- the name of a field of the queried entity, must be a one-to-one or a many-to-one property.value- the value the field of the entity must be equals to- Returns:
- the current or next step for a fluent interface usage
-
addNotEquals
- Specified by:
addNotEqualsin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
property- the name of a field of the queried entity, must be a one-to-one or a many-to-one property.value- the value the field of the entity must not be equals to- Returns:
- the current or next step for a fluent interface usage
-
addIn
- Specified by:
addInin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
property- the name of a field of the queried entity, must be a one-to-one or a many-to-one propertyvalues- a collection of values the field of the entity must be equals to- Returns:
- the current or next step for a fluent interface usage
-
addNotIn
public TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> addNotIn(String property, Collection<?> values) - Specified by:
addNotInin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
property- the name of a field of the queried entity, must be a one-to-one or a many-to-one propertyvalues- the value the field of the entity must not be equals to- Returns:
- the current or next step for a fluent interface usage
-
addContains
- Specified by:
addContainsin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
property- the name of a field of the queried entity, must be a one-to-many or a many-to-many propertyvalue- the property of the entity must be a collection that contains value- Returns:
- the current or next step for a fluent interface usage
-
addNotContains
- Specified by:
addNotContainsin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
property- the name of a field of the queried entity, must be a one-to-many or a many-to-many propertyvalue- the property of the entity must be a collection that doesn't contain value- Returns:
- the current or next step for a fluent interface usage
-
addNull
- Specified by:
addNullin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
property- the name of a field of the queried entity, must be a one-to-one or a many-to-one property- Returns:
- the current or next step for a fluent interface usage
-
addNotNull
- Specified by:
addNotNullin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
property- the name of a field of the queried entity, must be a one-to-one or a many-to-one property- Returns:
- the current or next step for a fluent interface usage
-
addTopiaIdEquals
public TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> addTopiaIdEquals(String property, String topiaId) Description copied from interface:TopiaQueryBuilderAddCriteriaStepThis method has the same behavior asTopiaQueryBuilderAddCriteriaStep.addEquals(String, Object)but you don't need to have the entity but only the topiaId. This method is useful when you want to do aTopiaQueryBuilderAddCriteriaStep.addEquals(String, Object)but you don't have the entity you want to give as an argument, you only have the topiaId.// given that we want to find an entity that has a boat property valued to a // boat which topiaId is boatId, we could write: addEquals("boat.topiaId", boatId); // boatId is a topiaId // but instead, you can write addTopiaIdEquals("boat", boatId); // boat is a topia entity- Specified by:
addTopiaIdEqualsin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
property- the name of a field of the queried entity, must be a one-to-one or a many-to-one propertytopiaId- the value the topiaId of the entity must be equals to- Returns:
- the current or next step for a fluent interface usage
-
addTopiaIdIn
public TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> addTopiaIdIn(String property, Collection<String> topiaIds) Description copied from interface:TopiaQueryBuilderAddCriteriaStepThis method has the same behavior asTopiaQueryBuilderAddCriteriaStep.addIn(String, Collection)but you don't need to have the entity but only the topiaId.- Specified by:
addTopiaIdInin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
property- the name of a field of the queried entity, must be a one-to-one or a many-to-one propertytopiaIds- a collection of values the topiaId of the entity must be equals to- Returns:
- the current or next step for a fluent interface usage
-
addTopiaIdNotEquals
public TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> addTopiaIdNotEquals(String property, String topiaId) Description copied from interface:TopiaQueryBuilderAddCriteriaStepThis method has the same behavior asTopiaQueryBuilderAddCriteriaStep.addNotEquals(String, Object)but you don't need to have the entity but only the topiaId.- Specified by:
addTopiaIdNotEqualsin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
property- the name of a field of the queried entity, must be a one-to-one or a many-to-one propertytopiaId- the value the topiaId of the entity must not be equals to- Returns:
- the current or next step for a fluent interface usage
-
addTopiaIdNotIn
public TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> addTopiaIdNotIn(String property, Collection<String> topiaIds) Description copied from interface:TopiaQueryBuilderAddCriteriaStepThis method has the same behavior asTopiaQueryBuilderAddCriteriaStep.addNotIn(String, Collection)but you don't need to have the entity but only the topiaId.- Specified by:
addTopiaIdNotInin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
property- the name of a field of the queried entity, must be a one-to-one or a many-to-one propertytopiaIds- a collection of values the topiaId of the entity must not be equals to- Returns:
- the current or next step for a fluent interface usage
-
addFetch
- Specified by:
addFetchin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
property- a property to load (fetch) with the entity(ies) (in a single query)- Returns:
- the current or next step for a fluent interface usage
-
addAllFetches
public TopiaQueryBuilderAddCriteriaOrRunQueryStep<E> addAllFetches(String property, String... otherProperties) - Specified by:
addAllFetchesin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
property- a property to load (fetch) with the entity(ies) (in a single query)otherProperties- an optional array of additional properties to load (fetch) with the entity(ies)- Returns:
- the current or next step for a fluent interface usage
-
addAllFetches
- Specified by:
addAllFetchesin interfaceTopiaQueryBuilderAddCriteriaStep<E extends TopiaEntity>- Parameters:
properties- a collection of properties to load (fetch) with the entity(ies) (in a single query)- Returns:
- the current or next step for a fluent interface usage
-
exists
public boolean exists()- Specified by:
existsin interfaceTopiaQueryBuilderRunQueryWithUniqueResultStep<E extends TopiaEntity>- Returns:
- true if the query returns at least one element
-
findAnyOrNull
Description copied from interface:TopiaQueryBuilderRunQueryStepGet the an element of the result set or null if query result is empty. This method does not guarantee any order as no ordering clause is mandatory. This method duplicatesTopiaQueryBuilderRunQueryStep.tryFindAny()but allows you to prevent using Guava in you project.- Specified by:
findAnyOrNullin interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Returns:
- the first value from the set of result, without any order guarantee. Returned value can be null
-
findUniqueOrNull
Description copied from interface:TopiaQueryBuilderRunQueryWithUniqueResultStepGet the first element of a single-element result set or null if query result is empty. This method duplicatesTopiaQueryBuilderRunQueryWithUniqueResultStep.tryFindUnique()but allows you to prevent using Guava in you project.- Specified by:
findUniqueOrNullin interfaceTopiaQueryBuilderRunQueryWithUniqueResultStep<E extends TopiaEntity>- Returns:
- the first value from the set of result, or null of result set for given query is empty.
-
findAny
Description copied from interface:TopiaQueryBuilderRunQueryStepGet the an element of the non-empty result set. This method does not guarantee any order as no ordering clause is mandatory- Specified by:
findAnyin interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Returns:
- the first value from the set of result, without any order guarantee. Returned value can't be null
-
findUnique
Description copied from interface:TopiaQueryBuilderRunQueryWithUniqueResultStepGet the first element of a single-element result set.- Specified by:
findUniquein interfaceTopiaQueryBuilderRunQueryWithUniqueResultStep<E extends TopiaEntity>- Returns:
- the first value from the set of result. Returned value can't be null
-
findFirst
Description copied from interface:TopiaQueryBuilderRunQueryStepGet the first element of the non-empty result set.- Specified by:
findFirstin interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Returns:
- the first value from the set of result, according to given order. Returned value can't be null
-
findFirstOrNull
Description copied from interface:TopiaQueryBuilderRunQueryStepGet the first element of the result set or null if query result is empty. This method duplicatesTopiaQueryBuilderRunQueryStep.tryFindFirst()but allows you to prevent using Guava in you project.- Specified by:
findFirstOrNullin interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Returns:
- the first value from the set of result, according to given order, or null of result set for given query is empty
-
tryFindAny
Description copied from interface:TopiaQueryBuilderRunQueryStepGet the an element of the result set. This method does not guarantee any order as no ordering clause is mandatory. If the call must return a result, preferTopiaQueryBuilderRunQueryStep.findAny()- Specified by:
tryFindAnyin interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Returns:
- the first value from the set of result, without any order guarantee. It's an optional because the query may return no result.
-
tryFindFirst
Description copied from interface:TopiaQueryBuilderRunQueryStepGet the first element of the result set. If the call must return a result, preferTopiaQueryBuilderRunQueryStep.findFirst()- Specified by:
tryFindFirstin interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Returns:
- the first value from the set of result, according to given order. It's an optional because the query may return no result.
-
tryFindUnique
Description copied from interface:TopiaQueryBuilderRunQueryWithUniqueResultStepGet the first element of a single-element result set. If the call must return a result, preferTopiaQueryBuilderRunQueryWithUniqueResultStep.findUnique()- Specified by:
tryFindUniquein interfaceTopiaQueryBuilderRunQueryWithUniqueResultStep<E extends TopiaEntity>- Returns:
- the first value from the set of result. It's an optional because the query may return no result.
-
findAll
Description copied from interface:TopiaQueryBuilderRunQueryStepGet all the elements of the result set.- Specified by:
findAllin interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Returns:
- the full list of results.
-
stream
Description copied from interface:TopiaQueryBuilderRunQueryStepLikeTopiaQueryBuilderRunQueryStep.findAll()but getting a stream that may lazily fetch data. Actual behavior rely on implementation. Caller shouldBaseStream.close()the stream.- Specified by:
streamin interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>
-
find
Description copied from interface:TopiaQueryBuilderRunQueryStepGet the elements with the given bounds.- Specified by:
findin interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Parameters:
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.- Returns:
- the list of loaded results.
-
find
Description copied from interface:TopiaQueryBuilderRunQueryStepGet the elements according to the givenPaginationParameter. UseTopiaQueryBuilderRunQueryStep.findPage(PaginationParameter)to get aPaginationResultinstead of a list.- Specified by:
findin interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Parameters:
page- information about the page to load.- Returns:
- the list of loaded results.
- See Also:
-
PaginationParameter
-
findPage
public org.nuiton.util.pagination.PaginationResult<E> findPage(org.nuiton.util.pagination.PaginationParameter page) Description copied from interface:TopiaQueryBuilderRunQueryStepGet the elements according to the givenPaginationParameter. UseTopiaQueryBuilderRunQueryStep.find(PaginationParameter)to get a list instead ofPaginationResult. Note: compared toTopiaQueryBuilderRunQueryStep.find(PaginationParameter), this method performs an additional statement to get the total elements count.- Specified by:
findPagein interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Parameters:
page- information about the page to load.- Returns:
- the list of loaded results.
- See Also:
-
PaginationParameterPaginationResult
-
findAllLazy
Description copied from interface:TopiaQueryBuilderRunQueryStepGet all the elements in a lazy loading list. The entities will be loaded gradually when the returned Iterable is iterated. If you wish to specify a batch size, useTopiaQueryBuilderRunQueryStep.findAllLazy(int)- Specified by:
findAllLazyin interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Returns:
- the full list of results which will be loaded gradually.
-
findAllLazy
Description copied from interface:TopiaQueryBuilderRunQueryStepGet all the elements in a lazy loading list. The entities will be loaded gradually when the returned Iterable is iterated. If you do not need to specify a batch size, useTopiaQueryBuilderRunQueryStep.findAllLazy()- Specified by:
findAllLazyin interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Parameters:
batchSize- the number of elements to load per request- Returns:
- the full list of results which will be loaded gradually.
-
count
public long count()Description copied from interface:TopiaQueryBuilderRunQueryStepThis method is equivalent as callingCollection.size()after doing aTopiaQueryBuilderRunQueryStep.findAll()but it may be faster.- Specified by:
countin interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Returns:
- the number of that the query would have returned, if executed
-
findIds
Description copied from interface:TopiaQueryBuilderRunQueryStepGet the elements identifiers with the given bounds. Note: compared toTopiaQueryBuilderRunQueryStep.find(int, int), this method will not load entities, only its identifier.- Specified by:
findIdsin interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Parameters:
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.- Returns:
- the list of loaded results ids.
-
findIds
Description copied from interface:TopiaQueryBuilderRunQueryStepGet the elements identifiers according to the givenPaginationParameter. UseTopiaQueryBuilderRunQueryStep.findIdsPage(PaginationParameter)to get aPaginationResultinstead of a list. Note: compared toTopiaQueryBuilderRunQueryStep.find(PaginationParameter), this method will not load entities, only its identifier.- Specified by:
findIdsin interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Parameters:
page- information about the page to load.- Returns:
- the list of loaded results ids.
- See Also:
-
PaginationParameter
-
findIdsPage
public org.nuiton.util.pagination.PaginationResult<String> findIdsPage(org.nuiton.util.pagination.PaginationParameter page) Description copied from interface:TopiaQueryBuilderRunQueryStepGet the elements identifiers according to the givenPaginationParameter. UseTopiaQueryBuilderRunQueryStep.findIds(PaginationParameter)to get a list instead ofPaginationResult. Note: compared toTopiaQueryBuilderRunQueryStep.findIds(PaginationParameter), this method performs an additional statement to get the total elements identifiers count. Note: compared toTopiaQueryBuilderRunQueryStep.findPage(PaginationParameter), this method will not load entities, only its identifier- Specified by:
findIdsPagein interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Parameters:
page- information about the page to load.- Returns:
- the list of loaded results.
- See Also:
-
PaginationParameterPaginationResult
-
findAllIds
Description copied from interface:TopiaQueryBuilderRunQueryStepGet all the elements identifiers of the result set. Note: compared toTopiaQueryBuilderRunQueryStep.findAll(), this method will not load entities, only its identifier.- Specified by:
findAllIdsin interfaceTopiaQueryBuilderRunQueryStep<E extends TopiaEntity>- Returns:
- the full list of results ids.
-
getNextStep
-