Class DefaultQueryModifierDelegate
java.lang.Object
com.vaadin.featurepack.data.jpacontainer.util.DefaultQueryModifierDelegate
- All Implemented Interfaces:
QueryModifierDelegate,Serializable
A default (empty) implementation of the
QueryModifierDelegate
interface. This is provided for the convenience of the developer who needs to
implement only a specific delegate method.- Since:
- 2.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfiltersWereAdded(jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, jakarta.persistence.criteria.CriteriaQuery<?> query) This method is called after all filters have been applied to the query.voidfiltersWillBeAdded(jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, jakarta.persistence.criteria.CriteriaQuery<?> query, List<jakarta.persistence.criteria.Predicate> predicates) This method is called after filters (in the form ofContainer.Filter) have been translated into instances ofPredicate, but before the resulting predicates have been added toquery.voidorderByWasAdded(jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, jakarta.persistence.criteria.CriteriaQuery<?> query) This method is called after the order by has been applied for the query.voidorderByWillBeAdded(jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, jakarta.persistence.criteria.CriteriaQuery<?> query, List<jakarta.persistence.criteria.Order> orderBy) This method is called after allSortByinstances have been translated intoOrderinstances, but before they have been applied to the query.voidqueryHasBeenBuilt(jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, jakarta.persistence.criteria.CriteriaQuery<?> query) This method is called after theCriteriaQueryinstance has been completely built (configured).voidqueryWillBeBuilt(jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, jakarta.persistence.criteria.CriteriaQuery<?> query) This method is called after theCriteriaQueryinstance (query) has been instantiated, but before any state has been set.
-
Constructor Details
-
DefaultQueryModifierDelegate
public DefaultQueryModifierDelegate()
-
-
Method Details
-
queryWillBeBuilt
public void queryWillBeBuilt(jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, jakarta.persistence.criteria.CriteriaQuery<?> query) This method is called after theCriteriaQueryinstance (query) has been instantiated, but before any state has been set. Operations and configuration may be performed on the query instance. This default implementation does nothing.- Specified by:
queryWillBeBuiltin interfaceQueryModifierDelegate- Parameters:
criteriaBuilder- theCriteriaBuilderused to build the queryquery- theCriteriaQuerybeing built
-
queryHasBeenBuilt
public void queryHasBeenBuilt(jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, jakarta.persistence.criteria.CriteriaQuery<?> query) This method is called after theCriteriaQueryinstance has been completely built (configured). Any operations may be performed on the query instance. This default implementation does nothing.- Specified by:
queryHasBeenBuiltin interfaceQueryModifierDelegate- Parameters:
criteriaBuilder- theCriteriaBuilderused to build the queryquery- theCriteriaQuerybeing built
-
filtersWillBeAdded
public void filtersWillBeAdded(jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, jakarta.persistence.criteria.CriteriaQuery<?> query, List<jakarta.persistence.criteria.Predicate> predicates) This method is called after filters (in the form ofContainer.Filter) have been translated into instances ofPredicate, but before the resulting predicates have been added toquery. The contents of thepredicateslist may be modified at this point. Any operations may be performed on the query instance. This default implementation does nothing.- Specified by:
filtersWillBeAddedin interfaceQueryModifierDelegate- Parameters:
criteriaBuilder- theCriteriaBuilderused to build the queryquery- theCriteriaQuerybeing builtpredicates- the list of predicates (Predicate) to be applied. The contents of this list may be modified.
-
filtersWereAdded
public void filtersWereAdded(jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, jakarta.persistence.criteria.CriteriaQuery<?> query) This method is called after all filters have been applied to the query. Any operations may be performed on the query instance. This default implementation does nothing.- Specified by:
filtersWereAddedin interfaceQueryModifierDelegate- Parameters:
criteriaBuilder- theCriteriaBuilderused to build the queryquery- theCriteriaQuerybeing built
-
orderByWillBeAdded
public void orderByWillBeAdded(jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, jakarta.persistence.criteria.CriteriaQuery<?> query, List<jakarta.persistence.criteria.Order> orderBy) This method is called after allSortByinstances have been translated intoOrderinstances, but before they have been applied to the query. The contents of theorderBylist may be modified at this point. Any operations may be performed on the query instance. This default implementation does nothing.- Specified by:
orderByWillBeAddedin interfaceQueryModifierDelegate- Parameters:
criteriaBuilder- theCriteriaBuilderused to build the queryquery- theCriteriaQuerybeing builtorderBy- the list of order by rules (Order) to be applied. The contents of this list may be modified.
-
orderByWasAdded
public void orderByWasAdded(jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, jakarta.persistence.criteria.CriteriaQuery<?> query) This method is called after the order by has been applied for the query. Any operations may be performed on the query instance. This default implementation does nothing.- Specified by:
orderByWasAddedin interfaceQueryModifierDelegate- Parameters:
criteriaBuilder- theCriteriaBuilderused to build the queryquery- theCriteriaQuerybeing built
-