Class JpaModelCriteriaBuilder<E,​M,​Self extends JpaModelCriteriaBuilder<E,​M,​Self>>

    • Constructor Detail

      • JpaModelCriteriaBuilder

        public JpaModelCriteriaBuilder​(Function<BiFunction<javax.persistence.criteria.CriteriaBuilder,​javax.persistence.criteria.Root<E>,​javax.persistence.criteria.Predicate>,​Self> instantiator)
      • JpaModelCriteriaBuilder

        public JpaModelCriteriaBuilder​(Function<BiFunction<javax.persistence.criteria.CriteriaBuilder,​javax.persistence.criteria.Root<E>,​javax.persistence.criteria.Predicate>,​Self> instantiator,
                                       BiFunction<javax.persistence.criteria.CriteriaBuilder,​javax.persistence.criteria.Root<E>,​javax.persistence.criteria.Predicate> predicateFunc)
      • JpaModelCriteriaBuilder

        public JpaModelCriteriaBuilder​(Function<BiFunction<javax.persistence.criteria.CriteriaBuilder,​javax.persistence.criteria.Root<E>,​javax.persistence.criteria.Predicate>,​Self> instantiator,
                                       BiFunction<javax.persistence.criteria.CriteriaBuilder,​javax.persistence.criteria.Root<E>,​javax.persistence.criteria.Predicate> predicateFunc,
                                       boolean isDistinct)
    • Method Detail

      • convertToJson

        protected String convertToJson​(Object input)
      • and

        @SafeVarargs
        public final Self and​(Self... builders)
        Description copied from interface: ModelCriteriaBuilder
        Creates and returns a new instance of ModelCriteriaBuilder that combines the given builders with the Boolean AND operator.

        Predicate coming out of and on an empty array of builders (i.e. empty conjunction) is always true.

           cb = storage.getCriteriaBuilder();
           storage.read(cb.or(
             cb.and(cb.compare(FIELD1, EQ, 1), cb.compare(FIELD2, EQ, 2)),
             cb.and(cb.compare(FIELD1, EQ, 3), cb.compare(FIELD2, EQ, 4))
           );
         
        Specified by:
        and in interface ModelCriteriaBuilder<E,​M>
      • or

        @SafeVarargs
        public final Self or​(Self... builders)
        Description copied from interface: ModelCriteriaBuilder
        Creates and returns a new instance of ModelCriteriaBuilder that combines the given builders with the Boolean OR operator.

        Predicate coming out of or on an empty array of builders (i.e. empty disjunction) is always false.

           cb = storage.getCriteriaBuilder();
           storage.read(cb.or(
             cb.compare(FIELD1, EQ, 1).compare(FIELD2, EQ, 2),
             cb.compare(FIELD1, EQ, 3).compare(FIELD2, EQ, 4)
           );
         
        Specified by:
        or in interface ModelCriteriaBuilder<E,​M>
      • not

        public Self not​(Self builder)
        Description copied from interface: ModelCriteriaBuilder
        Creates and returns a new instance of ModelCriteriaBuilder that negates the given builder.

        Note that if the builder has no condition yet, there is nothing to negate: empty negation is always true.

        Specified by:
        not in interface ModelCriteriaBuilder<E,​M>
        Returns:
      • getPredicateFunc

        public BiFunction<javax.persistence.criteria.CriteriaBuilder,​javax.persistence.criteria.Root<E>,​javax.persistence.criteria.Predicate> getPredicateFunc()
      • isDistinct

        public boolean isDistinct()