public class Criteria extends Object implements CriteriaDefinition
Criteria.property(…) method will improve readability as in
where(property(…).is(…).
The Criteria API supports composition with a NULL object and a static factory
method. Example usage:
Criteria.from(Criteria.where("name").is("Foo"), Criteria.from(Criteria.where("age").greaterThan(42)));
rendering:
WHERE name = 'Foo' AND age > 42
| Modifier and Type | Class and Description |
|---|---|
static interface |
Criteria.CriteriaStep
Interface declaring terminal builder methods to build a
Criteria. |
CriteriaDefinition.Combinator, CriteriaDefinition.Comparator| Modifier and Type | Method and Description |
|---|---|
Criteria |
and(CriteriaDefinition criteria)
|
Criteria |
and(List<? extends CriteriaDefinition> criteria)
|
Criteria.CriteriaStep |
and(String column)
|
static Criteria |
empty()
Static factory method to create an empty Criteria.
|
static Criteria |
from(Criteria... criteria)
|
static Criteria |
from(List<Criteria> criteria)
|
SqlIdentifier |
getColumn() |
CriteriaDefinition.Combinator |
getCombinator() |
CriteriaDefinition.Comparator |
getComparator() |
List<CriteriaDefinition> |
getGroup() |
Criteria |
getPrevious() |
Object |
getValue() |
boolean |
hasPrevious() |
Criteria |
ignoreCase(boolean ignoreCase)
Creates a new
Criteria with the given "ignore case" flag. |
boolean |
isEmpty() |
boolean |
isGroup() |
boolean |
isIgnoreCase()
Checks whether comparison should be done in case-insensitive way.
|
Criteria |
or(CriteriaDefinition criteria)
|
Criteria |
or(List<? extends CriteriaDefinition> criteria)
|
Criteria.CriteriaStep |
or(String column)
|
String |
toString() |
static Criteria.CriteriaStep |
where(String column)
Static factory method to create a Criteria using the provided
column name. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfrom, frompublic static Criteria empty()
empty in interface CriteriaDefinitionCriteria.public static Criteria.CriteriaStep where(String column)
column name.column - Must not be null or empty.Criteria.CriteriaStep object to complete the first Criteria.public Criteria.CriteriaStep and(String column)
column - Must not be null or empty.Criteria.CriteriaStep object to complete the next Criteria.public Criteria and(CriteriaDefinition criteria)
criteria - criteria object.Criteria object.public Criteria and(List<? extends CriteriaDefinition> criteria)
criteria - criteria objects.Criteria object.public Criteria.CriteriaStep or(String column)
column - Must not be null or empty.Criteria.CriteriaStep object to complete the next Criteria.public Criteria or(CriteriaDefinition criteria)
criteria - criteria object.Criteria object.public Criteria or(List<? extends CriteriaDefinition> criteria)
criteria - criteria object.Criteria object.public Criteria ignoreCase(boolean ignoreCase)
Criteria with the given "ignore case" flag.ignoreCase - true if comparison should be done in case-insensitive wayCriteria object@Nullable public Criteria getPrevious()
getPrevious in interface CriteriaDefinitionCriteria object. Can be null if there is no previous Criteria.hasPrevious()public boolean hasPrevious()
hasPrevious in interface CriteriaDefinitionCriteria has a previous one.public boolean isEmpty()
isEmpty in interface CriteriaDefinitionCriteria is empty.public boolean isGroup()
isGroup in interface CriteriaDefinitionCriteria is empty.public CriteriaDefinition.Combinator getCombinator()
getCombinator in interface CriteriaDefinitionCombinator to combine this criteria with a previous one.public List<CriteriaDefinition> getGroup()
getGroup in interface CriteriaDefinition@Nullable public SqlIdentifier getColumn()
getColumn in interface CriteriaDefinition@Nullable public CriteriaDefinition.Comparator getComparator()
getComparator in interface CriteriaDefinitionComparator.@Nullable public Object getValue()
getValue in interface CriteriaDefinitionpublic boolean isIgnoreCase()
isIgnoreCase in interface CriteriaDefinitionCopyright © 2017–2021 Pivotal Software, Inc.. All rights reserved.