com.jpattern.orm.query.clause.where
Class Expression

java.lang.Object
  extended by com.jpattern.orm.query.clause.where.Expression

public class Expression
extends Object

A factory helper to build ExpressionElements

Author:
ufo

Method Summary
static AndExpressionElement and(ExpressionElement... expressionElements)
          And - join more expressions with a logical and.
static AndExpressionElement and(List<ExpressionElement> expressionElements)
          And - join more expressions with a logical and.
static EqExpressionElement eq(String property, Object value)
          Express the "Equals to" relation between an object's property and a fixed value.
static EqPropertiesExpressionElement eqProperties(String firstProperty, String secondProperty)
          Express the "Equals to" relation between objects properties
static GeExpressionElement ge(String property, Object value)
          Express the "Greater or equals to" relation between an object's property and a fixed value.
static GePropertiesExpressionElement geProperties(String firstProperty, String secondProperty)
          Express the "Greater or equals to" relation between objects properties
static GtExpressionElement gt(String property, Object value)
          Express the "Greater than" relation between an object's property and a fixed value.
static GtPropertiesExpressionElement gtProperties(String firstProperty, String secondProperty)
          Express the "Greater than" relation between objects properties
static IEqExpressionElement ieq(String property, Object value)
          Express the "Insensitive Equal To" between an object's property and a fixed value (it uses a lower() function to make both case insensitive).
static IEqPropertiesExpressionElement ieqProperties(String firstProperty, String secondProperty)
          Express the "Insensitive Equal To" bbetween objects properties (it uses a lower() function to make both case insensitive).
static ILikeExpressionElement ilike(String property, Object value)
          Case insensitive Like - property like value where the value contains the SQL wild card characters % (percentage) and _ (underscore).
static InSubQueryExpressionElement in(String property, BaseFindQuery subQuery)
          In - using a subQuery.
static InExpressionElement in(String property, Collection<?> values)
          In - property has a value in the collection of values.
static InExpressionElement in(String property, Object[] values)
          In - property has a value in the array of values.
static IsNotNullExpressionElement isNotNull(String property)
          Is Not Null - property is not null.
static IsNullExpressionElement isNull(String property)
          Is Null - property is null.
static LeExpressionElement le(String property, Object value)
          Express the "Lesser or equals to" relation between an object's property and a fixed value.
static LePropertiesExpressionElement leProperties(String firstProperty, String secondProperty)
          Express the "Lesser or equals to" relation between objects properties
static LikeExpressionElement like(String property, Object value)
          Like - property like value where the value contains the SQL wild card characters % (percentage) and _ (underscore).
static LtExpressionElement lt(String property, Object value)
          Express the "Lesser than" relation between an object's property and a fixed value.
static LtPropertiesExpressionElement ltProperties(String firstProperty, String secondProperty)
          Express the "Lesser than" relation between objects properties
static NeExpressionElement ne(String property, Object value)
          Express the "Not Equals to" relation between objects properties.
static NePropertiesExpressionElement neProperties(String firstProperty, String secondProperty)
          Express the "Not Equals to" relation between an object's property and a fixed value.
static NInSubQueryExpressionElement nin(String property, BaseFindQuery subQuery)
          Not In - using a subQuery.
static NInExpressionElement nin(String property, Collection<?> values)
          Not In - property has a value in the collection of values.
static NInExpressionElement nin(String property, Object[] values)
          Not In - property has a value in the array of values.
static NLikeExpressionElement nlike(String property, Object value)
          Not Like - property like value where the value contains the SQL wild card characters % (percentage) and _ (underscore).
static NotExpressionElement not(ExpressionElement expression)
          Negate the expression (prefix it with NOT).
static OrExpressionElement or(ExpressionElement... expressionElements)
          Or - join more expressions with a logical or.
static OrExpressionElement or(List<ExpressionElement> expressionElements)
          Or - join more expressions with a logical or.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

eq

public static EqExpressionElement eq(String property,
                                     Object value)
Express the "Equals to" relation between an object's property and a fixed value.

Parameters:
property -
value -
Returns:

eqProperties

public static EqPropertiesExpressionElement eqProperties(String firstProperty,
                                                         String secondProperty)
Express the "Equals to" relation between objects properties

Parameters:
firstProperty -
secondProperty -
Returns:

le

public static LeExpressionElement le(String property,
                                     Object value)
Express the "Lesser or equals to" relation between an object's property and a fixed value.

Parameters:
property -
value -
Returns:

leProperties

public static LePropertiesExpressionElement leProperties(String firstProperty,
                                                         String secondProperty)
Express the "Lesser or equals to" relation between objects properties

Parameters:
firstProperty -
secondProperty -
Returns:

ge

public static GeExpressionElement ge(String property,
                                     Object value)
Express the "Greater or equals to" relation between an object's property and a fixed value.

Parameters:
property -
value -
Returns:

geProperties

public static GePropertiesExpressionElement geProperties(String firstProperty,
                                                         String secondProperty)
Express the "Greater or equals to" relation between objects properties

Parameters:
firstProperty -
secondProperty -
Returns:

lt

public static LtExpressionElement lt(String property,
                                     Object value)
Express the "Lesser than" relation between an object's property and a fixed value.

Parameters:
property -
value -
Returns:

ltProperties

public static LtPropertiesExpressionElement ltProperties(String firstProperty,
                                                         String secondProperty)
Express the "Lesser than" relation between objects properties

Parameters:
firstProperty -
secondProperty -
Returns:

gt

public static GtExpressionElement gt(String property,
                                     Object value)
Express the "Greater than" relation between an object's property and a fixed value.

Parameters:
property -
value -
Returns:

gtProperties

public static GtPropertiesExpressionElement gtProperties(String firstProperty,
                                                         String secondProperty)
Express the "Greater than" relation between objects properties

Parameters:
firstProperty -
secondProperty -
Returns:

ieq

public static IEqExpressionElement ieq(String property,
                                       Object value)
Express the "Insensitive Equal To" between an object's property and a fixed value (it uses a lower() function to make both case insensitive).

Parameters:
propertyName -
value -
Returns:

ieqProperties

public static IEqPropertiesExpressionElement ieqProperties(String firstProperty,
                                                           String secondProperty)
Express the "Insensitive Equal To" bbetween objects properties (it uses a lower() function to make both case insensitive).

Parameters:
firstProperty -
secondProperty -
Returns:

ne

public static NeExpressionElement ne(String property,
                                     Object value)
Express the "Not Equals to" relation between objects properties.

Parameters:
property -
value -
Returns:

neProperties

public static NePropertiesExpressionElement neProperties(String firstProperty,
                                                         String secondProperty)
Express the "Not Equals to" relation between an object's property and a fixed value.

Parameters:
firstProperty -
secondProperty -
Returns:

ilike

public static ILikeExpressionElement ilike(String property,
                                           Object value)
Case insensitive Like - property like value where the value contains the SQL wild card characters % (percentage) and _ (underscore).

Parameters:
propertyName -
value -
Returns:

nin

public static NInExpressionElement nin(String property,
                                       Collection<?> values)
Not In - property has a value in the collection of values.

Parameters:
propertyName -
values -
Returns:

nin

public static NInExpressionElement nin(String property,
                                       Object[] values)
Not In - property has a value in the array of values.

Parameters:
propertyName -
values -
Returns:

nin

public static NInSubQueryExpressionElement nin(String property,
                                               BaseFindQuery subQuery)
Not In - using a subQuery.

Parameters:
propertyName -
subQuery -
Returns:

in

public static InExpressionElement in(String property,
                                     Collection<?> values)
In - property has a value in the collection of values.

Parameters:
propertyName -
values -
Returns:

in

public static InExpressionElement in(String property,
                                     Object[] values)
In - property has a value in the array of values.

Parameters:
propertyName -
values -
Returns:

in

public static InSubQueryExpressionElement in(String property,
                                             BaseFindQuery subQuery)
In - using a subQuery.

Parameters:
propertyName -
subQuery -
Returns:

isNotNull

public static IsNotNullExpressionElement isNotNull(String property)
Is Not Null - property is not null.

Parameters:
propertyName -
Returns:

isNull

public static IsNullExpressionElement isNull(String property)
Is Null - property is null.

Parameters:
propertyName -
Returns:

like

public static LikeExpressionElement like(String property,
                                         Object value)
Like - property like value where the value contains the SQL wild card characters % (percentage) and _ (underscore).

Parameters:
propertyName -
value -

nlike

public static NLikeExpressionElement nlike(String property,
                                           Object value)
Not Like - property like value where the value contains the SQL wild card characters % (percentage) and _ (underscore).

Parameters:
propertyName -
value -

not

public static NotExpressionElement not(ExpressionElement expression)
Negate the expression (prefix it with NOT).

Parameters:
exp -
Returns:

or

public static OrExpressionElement or(ExpressionElement... expressionElements)
Or - join more expressions with a logical or.

Parameters:
expressionElements -
Returns:

or

public static OrExpressionElement or(List<ExpressionElement> expressionElements)
Or - join more expressions with a logical or.

Parameters:
expressionElements -
Returns:

and

public static AndExpressionElement and(List<ExpressionElement> expressionElements)
And - join more expressions with a logical and.

Parameters:
expressionElements -
Returns:

and

public static AndExpressionElement and(ExpressionElement... expressionElements)
And - join more expressions with a logical and.

Parameters:
expressionElements -
Returns:


Copyright © 2013. All Rights Reserved.