Class DescriptiveModelCriteria<M,​Self extends DescriptiveModelCriteria<M,​Self>>

    • Constructor Detail

      • DescriptiveModelCriteria

        protected DescriptiveModelCriteria​(ModelCriteriaNode<M> node)
    • Method Detail

      • and

        public Self and​(Self... mcbs)
        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<M,​Self extends DescriptiveModelCriteria<M,​Self>>
      • or

        public Self or​(Self... mcbs)
        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<M,​Self extends DescriptiveModelCriteria<M,​Self>>
      • flashToModelCriteriaBuilder

        public <C extends ModelCriteriaBuilder<M,​C>> C flashToModelCriteriaBuilder​(C mcb)
        Copies contents of this ModelCriteriaBuilder into another ModelCriteriaBuilder.
        Parameters:
        mcb - ModelCriteriaBuilder to copy the contents onto
        Returns:
        Updated ModelCriteriaBuilder
      • getSingleRestrictionArgument

        public <T extends DescriptiveModelCriteria<?,​?>> Object getSingleRestrictionArgument​(String fieldName)
        Returns the realm ID which limits the results of this criteria. Does not support formulae which include negation of a condition containing the given field. Only supports plain equality (ModelCriteriaBuilder.Operator.EQ), ignores all instances of the field comparison which do not use plain equality.
        Returns:
        null if the field is not contained in the formula, there are multiple mutually different field values in the formula, or the formula contains field check within a negation.
      • isEmpty

        public boolean isEmpty()