org.springframework.datastore.query
Class Restrictions

java.lang.Object
  extended by org.springframework.datastore.query.Restrictions

public class Restrictions
extends Object

Factory for creating Query.Criterion instances


Constructor Summary
Restrictions()
           
 
Method Summary
static Query.Criterion and(Query.Criterion a, Query.Criterion b)
           
static Query.Between between(String property, Object start, Object end)
          Restricts the results by the given property value range
static Query.Equals eq(String property, Object value)
          Restricts the property to be equal to the given value
static Query.GreaterThan gt(String property, Object value)
          Used to restrict a value to be greater than the given value
static Query.GreaterThanEquals gte(String property, Object value)
          Used to restrict a value to be greater than or equal to the given value
static Query.In in(String property, Collection values)
          Restricts the property to be in the list of given values
static Query.Like like(String property, String expression)
          Restricts the property match the given String expressions.
static Query.LessThan lt(String property, Object value)
          Used to restrict a value to be less than the given value
static Query.LessThanEquals lte(String property, Object value)
          Used to restrict a value to be less than or equal to the given value
static Query.Criterion or(Query.Criterion a, Query.Criterion b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Restrictions

public Restrictions()
Method Detail

eq

public static Query.Equals eq(String property,
                              Object value)
Restricts the property to be equal to the given value

Parameters:
property - The property
value - The value
Returns:
An instance of Query.Equals

in

public static Query.In in(String property,
                          Collection values)
Restricts the property to be in the list of given values

Parameters:
property - The property
values - The values
Returns:
An instance of Query.In

like

public static Query.Like like(String property,
                              String expression)
Restricts the property match the given String expressions. Expressions use SQL-like % to denote wildcards

Parameters:
property - The property name
expression - The expression
Returns:
An instance of Query.Like

and

public static Query.Criterion and(Query.Criterion a,
                                  Query.Criterion b)

or

public static Query.Criterion or(Query.Criterion a,
                                 Query.Criterion b)

between

public static Query.Between between(String property,
                                    Object start,
                                    Object end)
Restricts the results by the given property value range

Parameters:
property - The name of the property
start - The start of the range
end - The end of the range
Returns:
The Between instance

gt

public static Query.GreaterThan gt(String property,
                                   Object value)
Used to restrict a value to be greater than the given value

Parameters:
property - The property
value - The value
Returns:
The GreaterThan instance

lt

public static Query.LessThan lt(String property,
                                Object value)
Used to restrict a value to be less than the given value

Parameters:
property - The property
value - The value
Returns:
The LessThan instance

gte

public static Query.GreaterThanEquals gte(String property,
                                          Object value)
Used to restrict a value to be greater than or equal to the given value

Parameters:
property - The property
value - The value
Returns:
The LessThan instance

lte

public static Query.LessThanEquals lte(String property,
                                       Object value)
Used to restrict a value to be less than or equal to the given value

Parameters:
property - The property
value - The value
Returns:
The LessThan instance