Interface Criteria

All Known Subinterfaces:
QueryModel
All Known Implementing Classes:
AssociationQuery, DefaultQuery

public interface Criteria
Interface used for the construction of queries at compilation time an implementation may optionally provide an implementation of this at runtime.
Since:
1.0
Author:
Graeme Rocher
  • Method Summary

    Modifier and Type
    Method
    Description
    allEq(Map<String,Object> propertyValues)
    Apply an "equals" constraint to each property in the key set of a Map.
    and(Criteria other)
    Creates a logical conjunction.
    between(String propertyName, Object start, Object finish)
    Restricts the results by the given property value range (inclusive).
    contains(String propertyName, Object parameter)
    Restricts the property match to strings containing with the given value.
    endsWith(String propertyName, Object parameter)
    Restricts the property match to strings ending with the given value.
    eq(String propertyName, Object parameter)
    Creates an "equals" Criterion based on the specified property name and value.
    eqAll(String propertyName, Criteria propertyValue)
    Creates a subquery criterion that ensures the given property is equals to all the given returned values.
    eqProperty(String propertyName, String otherPropertyName)
    Constrains a property to be equal to a specified other property.
    ge(String property, Object parameter)
    Used to restrict a value to be greater than or equal to the given value.
    geAll(String propertyName, Criteria propertyValue)
    Creates a subquery criterion that ensures the given property is greater than or equals to all the given returned values.
    geProperty(String propertyName, String otherPropertyName)
    Constrains a property to be greater than or equal to a specified other property.
    geSome(String propertyName, Criteria propertyValue)
    Creates a subquery criterion that ensures the given property is greater than or equal to some of the given values.
    gt(String property, Object parameter)
    Used to restrict a value to be greater than or equal to the given value.
    gtAll(String propertyName, Criteria propertyValue)
    Creates a subquery criterion that ensures the given property is greater than all the given returned values.
    gte(String property, Object parameter)
    Used to restrict a value to be greater than or equal to the given value.
    gtProperty(String propertyName, String otherPropertyName)
    Constrains a property to be greater than a specified other property.
    gtSome(String propertyName, Criteria propertyValue)
    Creates a subquery criterion that ensures the given property is greater than some of the given values.
    idEq(Object parameter)
    Creates an "equals" Criterion based on the specified property name and value.
    ilike(String propertyName, Object parameter)
    Creates an ilike Criterion based on the specified property name and value.
    inList(String propertyName, QueryModel subquery)
    Creates an "in" Criterion using a subquery.
    inList(String propertyName, Object parameter)
    Creates an "in" Criterion based on the specified property name and list of values.
    isEmpty(String propertyName)
    Creates a criterion that asserts the given property is empty (such as a blank string).
    isFalse(String propertyName)
    Creates a criterion that asserts the given property is false.
    isNotEmpty(String propertyName)
    Creates a criterion that asserts the given property is not empty.
    isNotNull(String propertyName)
    Creates a criterion that asserts the given property is not null.
    isNull(String propertyName)
    Creates a criterion that asserts the given property is null.
    isTrue(String propertyName)
    Creates a criterion that asserts the given property is true.
    le(String property, Object parameter)
    Used to restrict a value to be less than or equal to the given value.
    leAll(String propertyName, Criteria propertyValue)
    Creates a subquery criterion that ensures the given property is less than or equal to all the given returned values.
    leProperty(String propertyName, String otherPropertyName)
    Constrains a property to be less than or equal to a specified other property.
    leSome(String propertyName, Criteria propertyValue)
    Creates a subquery criterion that ensures the given property is less than or equal to some of the given values.
    like(String propertyName, Object parameter)
    Creates a like Criterion based on the specified property name and value.
    lt(String property, Object parameter)
    Used to restrict a value to be less than or equal to the given value.
    ltAll(String propertyName, Criteria propertyValue)
    Creates a subquery criterion that ensures the given property is less than all the given returned values.
    lte(String property, Object parameter)
    Used to restrict a value to be less than or equal to the given value.
    ltProperty(String propertyName, String otherPropertyName)
    Constrains a property to be less than a specified other property.
    ltSome(String propertyName, Criteria propertyValue)
    Creates a subquery criterion that ensures the given property is less than some of the given values.
    ne(String propertyName, Object parameter)
    Creates a "not equals" Criterion based on the specified property name and value.
    neProperty(String propertyName, String otherPropertyName)
    Constrains a property to be not equal to a specified other property.
    not(Criteria other)
    Creates a logical negation.
    notIn(String propertyName, QueryModel subquery)
    Creates a negated "in" Criterion using a subquery.
    or(Criteria other)
    Creates a logical disjunction.
    rlike(String propertyName, Object parameter)
    Creates an rlike Criterion based on the specified property name and value.
    sizeEq(String propertyName, Object size)
    Creates a Criterion that constrains a collection property by size.
    sizeGe(String propertyName, Object size)
    Creates a Criterion that constrains a collection property to be greater than or equal to the given size.
    sizeGt(String propertyName, Object size)
    Creates a Criterion that constrains a collection property to be greater than the given size.
    sizeLe(String propertyName, Object size)
    Creates a Criterion that constrains a collection property to be less than or equal to the given size.
    sizeLt(String propertyName, Object size)
    Creates a Criterion that constrains a collection property to be less than to the given size.
    sizeNe(String propertyName, Object size)
    Creates a Criterion that constrains a collection property to be not equal to the given size.
    startsWith(String propertyName, Object parameter)
    Restricts the property match to strings starting with the given value.
    versionEq(Object parameter)
    Creates that restricts the version to the given value.
  • Method Details

    • idEq

      @NonNull Criteria idEq(Object parameter)
      Creates an "equals" Criterion based on the specified property name and value.
      Parameters:
      parameter - The parameter that provides the value
      Returns:
      The criteria
    • versionEq

      @NonNull Criteria versionEq(Object parameter)
      Creates that restricts the version to the given value.
      Parameters:
      parameter - The parameter that provides the value
      Returns:
      The criteria
    • isEmpty

      @NonNull Criteria isEmpty(@NonNull String propertyName)
      Creates a criterion that asserts the given property is empty (such as a blank string).
      Parameters:
      propertyName - The property name
      Returns:
      The criteria
    • isNotEmpty

      @NonNull Criteria isNotEmpty(@NonNull String propertyName)
      Creates a criterion that asserts the given property is not empty.
      Parameters:
      propertyName - The property name
      Returns:
      The criteria
    • isNull

      @NonNull Criteria isNull(@NonNull String propertyName)
      Creates a criterion that asserts the given property is null.
      Parameters:
      propertyName - The property name
      Returns:
      The criteria
    • isTrue

      @NonNull Criteria isTrue(@NonNull String propertyName)
      Creates a criterion that asserts the given property is true.
      Parameters:
      propertyName - The property name
      Returns:
      The criteria
    • isFalse

      @NonNull Criteria isFalse(@NonNull String propertyName)
      Creates a criterion that asserts the given property is false.
      Parameters:
      propertyName - The property name
      Returns:
      The criteria
    • isNotNull

      @NonNull Criteria isNotNull(String propertyName)
      Creates a criterion that asserts the given property is not null.
      Parameters:
      propertyName - The property name
      Returns:
      The criteria
    • eq

      @NonNull Criteria eq(String propertyName, Object parameter)
      Creates an "equals" Criterion based on the specified property name and value.
      Parameters:
      propertyName - The property name
      parameter - The parameter that provides the value
      Returns:
      The criteria
    • ne

      @NonNull Criteria ne(@NonNull String propertyName, @NonNull Object parameter)
      Creates a "not equals" Criterion based on the specified property name and value.
      Parameters:
      propertyName - The property name
      parameter - The parameter that provides the value
      Returns:
      The criteria
    • between

      @NonNull Criteria between(@NonNull String propertyName, @NonNull Object start, @NonNull Object finish)
      Restricts the results by the given property value range (inclusive).
      Parameters:
      propertyName - The property name
      start - The start of the range
      finish - The end of the range
      Returns:
      The criteria
    • gte

      @NonNull Criteria gte(@NonNull String property, @NonNull Object parameter)
      Used to restrict a value to be greater than or equal to the given value.
      Parameters:
      property - The property
      parameter - The parameter that provides the value
      Returns:
      The Criterion instance
    • ge

      @NonNull Criteria ge(@NonNull String property, @NonNull Object parameter)
      Used to restrict a value to be greater than or equal to the given value.
      Parameters:
      property - The property
      parameter - The parameter that provides the value
      Returns:
      The Criterion instance
    • gt

      @NonNull Criteria gt(@NonNull String property, @NonNull Object parameter)
      Used to restrict a value to be greater than or equal to the given value.
      Parameters:
      property - The property
      parameter - The parameter that provides the value
      Returns:
      The Criterion instance
    • lte

      @NonNull Criteria lte(@NonNull String property, @NonNull Object parameter)
      Used to restrict a value to be less than or equal to the given value.
      Parameters:
      property - The property
      parameter - The parameter that provides the value
      Returns:
      The Criterion instance
    • le

      @NonNull Criteria le(@NonNull String property, @NonNull Object parameter)
      Used to restrict a value to be less than or equal to the given value.
      Parameters:
      property - The property
      parameter - The parameter that provides the value
      Returns:
      The Criterion instance
    • lt

      @NonNull Criteria lt(@NonNull String property, @NonNull Object parameter)
      Used to restrict a value to be less than or equal to the given value.
      Parameters:
      property - The property
      parameter - The parameter that provides the value
      Returns:
      The Criterion instance
    • like

      @NonNull Criteria like(@NonNull String propertyName, @NonNull Object parameter)
      Creates a like Criterion based on the specified property name and value.
      Parameters:
      propertyName - The property name
      parameter - The parameter that provides the value
      Returns:
      The criteria
    • startsWith

      @NonNull Criteria startsWith(@NonNull String propertyName, @NonNull Object parameter)
      Restricts the property match to strings starting with the given value.
      Parameters:
      propertyName - The property name
      parameter - The parameter that provides the value
      Returns:
      The criteria
    • endsWith

      @NonNull Criteria endsWith(@NonNull String propertyName, @NonNull Object parameter)
      Restricts the property match to strings ending with the given value.
      Parameters:
      propertyName - The property name
      parameter - The parameter that provides the value
      Returns:
      The criteria
    • contains

      @NonNull Criteria contains(@NonNull String propertyName, @NonNull Object parameter)
      Restricts the property match to strings containing with the given value.
      Parameters:
      propertyName - The property name
      parameter - The parameter that provides the value
      Returns:
      The criteria
    • ilike

      @NonNull Criteria ilike(@NonNull String propertyName, @NonNull Object parameter)
      Creates an ilike Criterion based on the specified property name and value. Unlike a like condition, ilike is case insensitive.
      Parameters:
      propertyName - The property name
      parameter - The parameter that provides the value
      Returns:
      The criteria
    • rlike

      @NonNull Criteria rlike(@NonNull String propertyName, @NonNull Object parameter)
      Creates an rlike Criterion based on the specified property name and value.
      Parameters:
      propertyName - The property name
      parameter - The parameter that provides the value
      Returns:
      The criteria
    • and

      @NonNull Criteria and(@NonNull Criteria other)
      Creates a logical conjunction.
      Parameters:
      other - The other criteria
      Returns:
      This criteria
    • or

      @NonNull Criteria or(@NonNull Criteria other)
      Creates a logical disjunction.
      Parameters:
      other - The other criteria
      Returns:
      This criteria
    • not

      @NonNull Criteria not(@NonNull Criteria other)
      Creates a logical negation.
      Parameters:
      other - The other criteria
      Returns:
      This criteria
    • inList

      @NonNull Criteria inList(@NonNull String propertyName, @NonNull QueryModel subquery)
      Creates an "in" Criterion using a subquery.
      Parameters:
      propertyName - The property name
      subquery - The subquery
      Returns:
      The criteria
    • inList

      @NonNull Criteria inList(@NonNull String propertyName, @NonNull Object parameter)
      Creates an "in" Criterion based on the specified property name and list of values.
      Parameters:
      propertyName - The property name
      parameter - The parameter that provides the value
      Returns:
      The criteria
    • notIn

      @NonNull Criteria notIn(@NonNull String propertyName, @NonNull QueryModel subquery)
      Creates a negated "in" Criterion using a subquery.
      Parameters:
      propertyName - The property name
      subquery - The subquery
      Returns:
      The criteria
    • sizeEq

      @NonNull Criteria sizeEq(@NonNull String propertyName, @NonNull Object size)
      Creates a Criterion that constrains a collection property by size.
      Parameters:
      propertyName - The property name
      size - The size to constrain by
      Returns:
      This criteria
    • sizeGt

      @NonNull Criteria sizeGt(@NonNull String propertyName, @NonNull Object size)
      Creates a Criterion that constrains a collection property to be greater than the given size.
      Parameters:
      propertyName - The property name
      size - The size to constrain by
      Returns:
      This criteria
    • sizeGe

      @NonNull Criteria sizeGe(@NonNull String propertyName, @NonNull Object size)
      Creates a Criterion that constrains a collection property to be greater than or equal to the given size.
      Parameters:
      propertyName - The property name
      size - The size to constrain by
      Returns:
      This criteria
    • sizeLe

      @NonNull Criteria sizeLe(@NonNull String propertyName, @NonNull Object size)
      Creates a Criterion that constrains a collection property to be less than or equal to the given size.
      Parameters:
      propertyName - The property name
      size - The size to constrain by
      Returns:
      This criteria
    • sizeLt

      @NonNull Criteria sizeLt(@NonNull String propertyName, @NonNull Object size)
      Creates a Criterion that constrains a collection property to be less than to the given size.
      Parameters:
      propertyName - The property name
      size - The size to constrain by
      Returns:
      This criteria
    • sizeNe

      @NonNull Criteria sizeNe(@NonNull String propertyName, @NonNull Object size)
      Creates a Criterion that constrains a collection property to be not equal to the given size.
      Parameters:
      propertyName - The property name
      size - The size to constrain by
      Returns:
      This criteria
    • eqProperty

      @NonNull Criteria eqProperty(@NonNull String propertyName, @NonNull String otherPropertyName)
      Constrains a property to be equal to a specified other property.
      Parameters:
      propertyName - The property
      otherPropertyName - The other property
      Returns:
      This criteria
    • neProperty

      @NonNull Criteria neProperty(@NonNull String propertyName, @NonNull String otherPropertyName)
      Constrains a property to be not equal to a specified other property.
      Parameters:
      propertyName - The property
      otherPropertyName - The other property
      Returns:
      This criteria
    • gtProperty

      @NonNull Criteria gtProperty(@NonNull String propertyName, @NonNull String otherPropertyName)
      Constrains a property to be greater than a specified other property.
      Parameters:
      propertyName - The property
      otherPropertyName - The other property
      Returns:
      This criteria
    • geProperty

      @NonNull Criteria geProperty(@NonNull String propertyName, @NonNull String otherPropertyName)
      Constrains a property to be greater than or equal to a specified other property.
      Parameters:
      propertyName - The property
      otherPropertyName - The other property
      Returns:
      This criteria
    • ltProperty

      @NonNull Criteria ltProperty(@NonNull String propertyName, @NonNull String otherPropertyName)
      Constrains a property to be less than a specified other property.
      Parameters:
      propertyName - The property
      otherPropertyName - The other property
      Returns:
      This criteria
    • leProperty

      @NonNull Criteria leProperty(String propertyName, @NonNull String otherPropertyName)
      Constrains a property to be less than or equal to a specified other property.
      Parameters:
      propertyName - The property
      otherPropertyName - The other property
      Returns:
      This criteria
    • allEq

      @NonNull Criteria allEq(@NonNull Map<String,Object> propertyValues)
      Apply an "equals" constraint to each property in the key set of a Map.
      Parameters:
      propertyValues - a map from property names to values
      Returns:
      Criterion
    • eqAll

      @NonNull Criteria eqAll(@NonNull String propertyName, @NonNull Criteria propertyValue)
      Creates a subquery criterion that ensures the given property is equals to all the given returned values.
      Parameters:
      propertyName - The property name
      propertyValue - A subquery
      Returns:
      This criterion instance
    • gtAll

      @NonNull Criteria gtAll(@NonNull String propertyName, @NonNull Criteria propertyValue)
      Creates a subquery criterion that ensures the given property is greater than all the given returned values.
      Parameters:
      propertyName - The property name
      propertyValue - A subquery
      Returns:
      This criterion instance
    • ltAll

      @NonNull Criteria ltAll(@NonNull String propertyName, @NonNull Criteria propertyValue)
      Creates a subquery criterion that ensures the given property is less than all the given returned values.
      Parameters:
      propertyName - The property name
      propertyValue - A subquery
      Returns:
      This criterion instance
    • geAll

      @NonNull Criteria geAll(@NonNull String propertyName, @NonNull Criteria propertyValue)
      Creates a subquery criterion that ensures the given property is greater than or equals to all the given returned values.
      Parameters:
      propertyName - The property name
      propertyValue - A subquery
      Returns:
      This criterion instance
    • leAll

      @NonNull Criteria leAll(@NonNull String propertyName, @NonNull Criteria propertyValue)
      Creates a subquery criterion that ensures the given property is less than or equal to all the given returned values.
      Parameters:
      propertyName - The property name
      propertyValue - A subquery
      Returns:
      This criterion instance
    • gtSome

      @NonNull Criteria gtSome(@NonNull String propertyName, @NonNull Criteria propertyValue)
      Creates a subquery criterion that ensures the given property is greater than some of the given values.
      Parameters:
      propertyName - The property name
      propertyValue - The property value
      Returns:
      This Criteria instance
    • geSome

      @NonNull Criteria geSome(@NonNull String propertyName, @NonNull Criteria propertyValue)
      Creates a subquery criterion that ensures the given property is greater than or equal to some of the given values.
      Parameters:
      propertyName - The property name
      propertyValue - The property value
      Returns:
      This Criteria instance
    • ltSome

      @NonNull Criteria ltSome(@NonNull String propertyName, @NonNull Criteria propertyValue)
      Creates a subquery criterion that ensures the given property is less than some of the given values.
      Parameters:
      propertyName - The property name
      propertyValue - The property value
      Returns:
      This Criteria instance
    • leSome

      @NonNull Criteria leSome(@NonNull String propertyName, @NonNull Criteria propertyValue)
      Creates a subquery criterion that ensures the given property is less than or equal to some of the given values.
      Parameters:
      propertyName - The property name
      propertyValue - The property value
      Returns:
      This Criteria instance