Class Criteria

    • Constructor Detail

      • Criteria

        public Criteria()
        Constructs a default instance of this class.
    • Method Detail

      • clone

        public abstract Object clone()
        Abstract clone method
        Specified by:
        clone in interface LanguageObject
        Overrides:
        clone in class Object
        Returns:
        Deep clone of this criteria
      • toString

        public String toString()
        Return the parser string.
        Overrides:
        toString in class Object
      • separateCriteriaByAnd

        public static List<Criteria> separateCriteriaByAnd​(Criteria crit)
        This utility method will pull apart a tree of criteria by breaking all compound AND criteria apart. For instance, ((A=1 AND B=2) AND C=3) will be broken into A=1, B=2, C=3.
        Parameters:
        crit - Criteria to break apart
        Returns:
        List of Criteria, empty list if crit is null
      • combineCriteria

        public static Criteria combineCriteria​(Criteria primaryCrit,
                                               Criteria additionalCrit)
        This utility method can be used to combine two criteria using an AND. If both criteria are null, then null will be returned. If either is null, then the other will be returned. If neither is null and the primaryCrit is a CompoundCriteria, then the additionalCrit will be added to the primaryCrit and the primaryCrit will be returned. If the primaryCrit is not compound, a new CompoundCriteria will be created and both criteria will be added to it.
        Parameters:
        primaryCrit - Primary criteria - may be modified
        additionalCrit - Won't be modified, but will likely be attached to the returned crit
        Returns:
        Combined criteria
      • combineCriteria

        public static Criteria combineCriteria​(Criteria primaryCrit,
                                               Criteria additionalCrit,
                                               boolean disjunctively)
      • getType

        public Class<?> getType()
        Description copied from interface: Expression
        Get the return type of this expression.
        Specified by:
        getType in interface Expression
        Returns:
        Java class may be null prior to being resolved