Package io.vertigo.datamodel.criteria
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
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn a new criteria composing the previous criteria and the provided one with a and operator.Return a new criteria composing the previous criteria and the provided one with a or operator.Translate the criteria to a Java predicatetoString()io.vertigo.core.lang.Tuple<String, CriteriaCtx> toStringAnCtx(CriteriaEncoder criteriaEncoder) Translate the criteria to a SQL statement
-
Constructor Details
-
Criteria
public Criteria()
-
-
Method Details
-
and
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
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
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
-