Package io.vertigo.datamodel.criteria
Class Criteria<D extends DtObject>
- 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 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 classCriterions
- Author:
- mlaroche
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Criteria()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Criteria<D>
and(Criteria<D> criteria)
Return a new criteria composing the previous criteria and the provided one with a and operator.Criteria<D>
or(Criteria<D> criteria)
Return a new criteria composing the previous criteria and the provided one with a or operator.abstract Predicate<D>
toPredicate()
Translate the criteria to a Java predicateString
toString()
io.vertigo.core.lang.Tuple<String,CriteriaCtx>
toStringAnCtx(CriteriaEncoder criteriaEncoder)
Translate the criteria to a SQL statement
-
-
-
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
-
-