@java.lang.FunctionalInterface public interface PredicateGenerator.CriterionHandler
Extension point for user-defined criterion handlers. Register a handler for a custom Query.Criterion subclass to have it converted to a JPA jakarta.persistence.criteria.Predicate during query execution. Registered handlers are checked first, before any built-in criterion handling, so a handler can also override built-in behavior.
Example registration (e.g., in BootStrap.groovy):
PredicateGenerator.registerCriterionHandler(MyCustomCriterion) { query, root, cb, criterion ->
def c = criterion as MyCustomCriterion
cb.like(cb.cast(root.get(c.property), String), c.value)
}
C - the specific criterion type| Type Params | Return Type | Name and description |
|---|---|---|
|
public jakarta.persistence.criteria.Predicate |
handle(jakarta.persistence.criteria.AbstractQuery<?> criteriaQuery, jakarta.persistence.criteria.From<?, ?> root, org.hibernate.query.criteria.HibernateCriteriaBuilder criteriaBuilder, Criterion criterion) |