Class Criteria<D extends DtObject>

  • Type Parameters:
    D - the type of dtObject filtered with this criteria
    All Implemented Interfaces:
    Serializable

    public abstract class Criteria<D extends DtObject>
    extends Object
    implements Serializable
    A criteria to filter a list. A criteria can be translated to an SQL query and a Predicate for Java filtering To create a Criteria use the class Criterions
    Author:
    mlaroche
    See Also:
    Serialized Form
    • Constructor Detail

      • Criteria

        public Criteria()
    • Method Detail

      • and

        public final Criteria<D> and​(Criteria<D> criteria)
        Return a new criteria composing the previous criteria and the provided one with a and operator.
        Parameters:
        criteria - the criteria to add
        Returns:
        the composed criteria
      • or

        public final Criteria<D> or​(Criteria<D> criteria)
        Return a new criteria composing the previous criteria and the provided one with a or operator.
        Parameters:
        criteria - the criteria to add
        Returns:
        the composed criteria
      • toPredicate

        public abstract Predicate<D> toPredicate()
        Translate the criteria to a Java predicate
        Returns:
        the predicate
      • toStringAnCtx

        public io.vertigo.core.lang.Tuple<String,​CriteriaCtx> toStringAnCtx​(CriteriaEncoder criteriaEncoder)
        Translate the criteria to a SQL statement
        Parameters:
        sqlDialect - the dialect to use
        Returns:
        a tuple with the query and the sql params