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

    • idEq

      @NonNull @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 @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 @NonNull Criteria isEmpty(@NonNull @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 @NonNull Criteria isNotEmpty(@NonNull @NonNull String propertyName)
      Creates a criterion that asserts the given property is not empty.
      Parameters:
      propertyName - The property name
      Returns:
      The criteria
    • isNull

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

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

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

      @NonNull @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 @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 @NonNull Criteria ne(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria between(@NonNull @NonNull String propertyName, @NonNull @NonNull Object start, @NonNull @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 @NonNull Criteria gte(@NonNull @NonNull String property, @NonNull @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 @NonNull Criteria ge(@NonNull @NonNull String property, @NonNull @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 @NonNull Criteria gt(@NonNull @NonNull String property, @NonNull @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 @NonNull Criteria lte(@NonNull @NonNull String property, @NonNull @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 @NonNull Criteria le(@NonNull @NonNull String property, @NonNull @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 @NonNull Criteria lt(@NonNull @NonNull String property, @NonNull @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 @NonNull Criteria like(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria startsWith(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria endsWith(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria contains(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria ilike(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria rlike(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria and(@NonNull @NonNull Criteria other)
      Creates a logical conjunction.
      Parameters:
      other - The other criteria
      Returns:
      This criteria
    • or

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

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

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

      @NonNull @NonNull Criteria inList(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria notIn(@NonNull @NonNull String propertyName, @NonNull @NonNull QueryModel subquery)
      Creates a negated "in" Criterion using a subquery.
      Parameters:
      propertyName - The property name
      subquery - The subquery
      Returns:
      The criteria
    • sizeEq

      @NonNull @NonNull Criteria sizeEq(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria sizeGt(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria sizeGe(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria sizeLe(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria sizeLt(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria sizeNe(@NonNull @NonNull String propertyName, @NonNull @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 @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 @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 @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 @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 @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 @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 @NonNull Criteria allEq(@NonNull @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 @NonNull Criteria eqAll(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria gtAll(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria ltAll(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria geAll(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria leAll(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria gtSome(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria geSome(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria ltSome(@NonNull @NonNull String propertyName, @NonNull @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 @NonNull Criteria leSome(@NonNull @NonNull String propertyName, @NonNull @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