Interface CriteriaTranslatorEventHandler
public interface CriteriaTranslatorEventHandler
Event handler for adding restrictions to criteria created for admin fetch requests
- Author:
- Jeff Fischer
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddRestrictions(String ceilingEntity, List<FilterMapping> filterMappings, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, jakarta.persistence.criteria.Root original, List<jakarta.persistence.criteria.Predicate> restrictions, List<jakarta.persistence.criteria.Order> sorts, jakarta.persistence.criteria.CriteriaQuery criteria) Allows the ability to attach additional criteria to the given criteria that has already been created by the given filterMappings.
-
Method Details
-
addRestrictions
void addRestrictions(String ceilingEntity, List<FilterMapping> filterMappings, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, jakarta.persistence.criteria.Root original, List<jakarta.persistence.criteria.Predicate> restrictions, List<jakarta.persistence.criteria.Order> sorts, jakarta.persistence.criteria.CriteriaQuery criteria) Allows the ability to attach additional criteria to the given criteria that has already been created by the given filterMappings. Since translation has already occurred from the filterMappings into the given restrictions, implementers should attach additional criteria to that list rather than attach to criteria directly.
These
- Parameters:
ceilingEntity- the entity currently being fetchedfilterMappings- the DTO of filters harvested fromFieldPersistenceProviderscriteriaBuilder- used for adding additional restrictionsoriginal- the Hibernate root from which restriction paths start fromrestrictions- existing list of restrictions that have not yet been applied to criteriasorts- list of sorts that have not yet been applied to criteria>criteria- the final criteria without any of the restrictions or sorts applied to it. AdditionalPredicates should not be attached to this directly but rather to the given restrictions or sorts
-