Class Criteria<D extends DataObject>

java.lang.Object
io.vertigo.datamodel.criteria.Criteria<D>
Type Parameters:
D - the type of dtObject filtered with this criteria
All Implemented Interfaces:
Serializable

public abstract class Criteria<D extends DataObject> 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:
  • Constructor Details

    • Criteria

      public Criteria()
  • Method Details

    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object