Class Between<T extends Comparable<T>>


  • public final class Between<T extends Comparable<T>>
    extends Criteria<org.omnifaces.utils.data.Range<T>>
    Creates path BETWEEN range.min AND range.max.
    Author:
    Bauke Scholtz
    • Method Detail

      • value

        public static <T extends Comparable<T>> Between<T> value​(org.omnifaces.utils.data.Range<T> value)
      • range

        public static <T extends Comparable<T>> Between<T> range​(T min,
                                                                 T max)
      • build

        public Predicate build​(Expression<?> path,
                               CriteriaBuilder criteriaBuilder,
                               Criteria.ParameterBuilder parameterBuilder)
        Description copied from class: Criteria
        Returns a predicate for the criteria value. Below is an example implementation:
         return criteriaBuilder.equal(path, parameterBuilder.create(getValue()));
         
        Specified by:
        build in class Criteria<org.omnifaces.utils.data.Range<T extends Comparable<T>>>
        Parameters:
        path - Entity property path. You can use this to inspect the target entity property.
        criteriaBuilder - So you can build a predicate with a ParameterExpression.
        parameterBuilder - You must use this to create a ParameterExpression for the criteria value.
        Returns:
        A predicate for the criteria value.
      • applies

        public boolean applies​(Object modelValue)
        Description copied from class: Criteria
        Returns whether this criteria value would apply to the given model value. This must basically represent the "plain Java" equivalent of the SQL behavior as achieved by Criteria.build(Expression, CriteriaBuilder, ParameterBuilder).
        Overrides:
        applies in class Criteria<org.omnifaces.utils.data.Range<T extends Comparable<T>>>
        Parameters:
        modelValue - The model value to test this criteria on.
        Returns:
        Whether this criteria value would apply to the given model value.