org.springframework.data.relational.core.query

## Class Criteria

- java.lang.Object
- - org.springframework.data.relational.core.query.Criteria

All Implemented Interfaces:
  CriteriaDefinition

    public class Criteria
    extends Object
    implements CriteriaDefinition

Central class for creating queries. It follows a fluent API style so that you can easily chain together multiple criteria. Static import of the `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

Since:
  2.0
Author:
  Mark Paluch, Oliver Drotbohm, Roman Chigvintsev, Jens Schauder

### Nested Class Summary

Nested Classes
`static interface` `Criteria.CriteriaStep` Interface declaring terminal builder methods to build a `Criteria`.

### Nested classes/interfaces inherited from interface org.springframework.data.relational.core.query.CriteriaDefinition

`CriteriaDefinition.Combinator, CriteriaDefinition.Comparator`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`Criteria` `and(CriteriaDefinition criteria)` Create a new `Criteria` and combine it as group with `AND` using the provided `Criteria` group.
`Criteria` `and(List<? extends CriteriaDefinition> criteria)` Create a new `Criteria` and combine it as group with `AND` using the provided `Criteria` group.
`Criteria.CriteriaStep` `and(String column)` Create a new `Criteria` and combine it with `AND` using the provided `column` name.
`static Criteria` `empty()` Static factory method to create an empty Criteria.
`static Criteria` `from(Criteria... criteria)` Create a new `Criteria` and combine it as group with `AND` using the provided `Criterias`.
`static Criteria` `from(List<Criteria> criteria)` Create a new `Criteria` and combine it as group with `AND` using the provided `Criterias`.
`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)` Create a new `Criteria` and combine it as group with `OR` using the provided `Criteria` group.
`Criteria` `or(List<? extends CriteriaDefinition> criteria)` Create a new `Criteria` and combine it as group with `OR` using the provided `Criteria` group.
`Criteria.CriteriaStep` `or(String column)` Create a new `Criteria` and combine it with `OR` using the provided `column` name.
`String` `toString()`
`static Criteria.CriteriaStep` `where(String column)` Static factory method to create a Criteria using the provided `column` name.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.springframework.data.relational.core.query.CriteriaDefinition

`from, from`

### Method Detail

#### empty

    public static Criteria empty()

Static factory method to create an empty Criteria.

Specified by:
  `empty` in interface `CriteriaDefinition`
Returns:
  an empty `Criteria`.

#### from

    public static Criteria from(Criteria... criteria)

Create a new `Criteria` and combine it as group with `AND` using the provided `Criterias`.

Returns:
  new `Criteria`.

#### from

    public static Criteria from(List<Criteria> criteria)

Create a new `Criteria` and combine it as group with `AND` using the provided `Criterias`.

Returns:
  new `Criteria`.

#### where

    public static Criteria.CriteriaStep where(String column)

Static factory method to create a Criteria using the provided `column` name.

Parameters:
  `column` - Must not be null or empty.
Returns:
  a new `Criteria.CriteriaStep` object to complete the first `Criteria`.

#### and

    public Criteria.CriteriaStep and(String column)

Create a new `Criteria` and combine it with `AND` using the provided `column` name.

Parameters:
  `column` - Must not be null or empty.
Returns:
  a new `Criteria.CriteriaStep` object to complete the next `Criteria`.

#### and

    public Criteria and(CriteriaDefinition criteria)

Create a new `Criteria` and combine it as group with `AND` using the provided `Criteria` group.

Parameters:
  `criteria` - criteria object.
Returns:
  a new `Criteria` object.
Since:
  1.1

#### and

    public Criteria and(List<? extends CriteriaDefinition> criteria)

Create a new `Criteria` and combine it as group with `AND` using the provided `Criteria` group.

Parameters:
  `criteria` - criteria objects.
Returns:
  a new `Criteria` object.

#### or

    public Criteria.CriteriaStep or(String column)

Create a new `Criteria` and combine it with `OR` using the provided `column` name.

Parameters:
  `column` - Must not be null or empty.
Returns:
  a new `Criteria.CriteriaStep` object to complete the next `Criteria`.

#### or

    public Criteria or(CriteriaDefinition criteria)

Create a new `Criteria` and combine it as group with `OR` using the provided `Criteria` group.

Parameters:
  `criteria` - criteria object.
Returns:
  a new `Criteria` object.
Since:
  1.1

#### or

    public Criteria or(List<? extends CriteriaDefinition> criteria)

Create a new `Criteria` and combine it as group with `OR` using the provided `Criteria` group.

Parameters:
  `criteria` - criteria object.
Returns:
  a new `Criteria` object.
Since:
  1.1

#### ignoreCase

    public Criteria ignoreCase(boolean ignoreCase)

Creates a new `Criteria` with the given "ignore case" flag.

Parameters:
  `ignoreCase` - true if comparison should be done in case-insensitive way
Returns:
  a new `Criteria` object

#### getPrevious

    @Nullable
    public Criteria getPrevious()

Specified by:
  `getPrevious` in interface `CriteriaDefinition`
Returns:
  the previous `Criteria` object. Can be null if there is no previous `Criteria`.
See Also:
  `hasPrevious()`

#### hasPrevious

    public boolean hasPrevious()

Specified by:
  `hasPrevious` in interface `CriteriaDefinition`
Returns:
  true if this `Criteria` has a previous one.

#### isEmpty

    public boolean isEmpty()

Specified by:
  `isEmpty` in interface `CriteriaDefinition`
Returns:
  true if this `Criteria` is empty.
Since:
  1.1

#### isGroup

    public boolean isGroup()

Specified by:
  `isGroup` in interface `CriteriaDefinition`
Returns:
  true if this `Criteria` is empty.

#### getCombinator

    public CriteriaDefinition.Combinator getCombinator()

Specified by:
  `getCombinator` in interface `CriteriaDefinition`
Returns:
  `Combinator` to combine this criteria with a previous one.

#### getGroup

    public List<CriteriaDefinition> getGroup()

Specified by:
  `getGroup` in interface `CriteriaDefinition`

#### getColumn

    @Nullable
    public SqlIdentifier getColumn()

Specified by:
  `getColumn` in interface `CriteriaDefinition`
Returns:
  the column/property name.

#### getComparator

    @Nullable
    public CriteriaDefinition.Comparator getComparator()

Specified by:
  `getComparator` in interface `CriteriaDefinition`
Returns:
  `Comparator`.

#### getValue

    @Nullable
    public Object getValue()

Specified by:
  `getValue` in interface `CriteriaDefinition`
Returns:
  the comparison value. Can be null.

#### isIgnoreCase

    public boolean isIgnoreCase()

Checks whether comparison should be done in case-insensitive way.

Specified by:
  `isIgnoreCase` in interface `CriteriaDefinition`
Returns:
  true if comparison should be done in case-insensitive way

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`