com.googlecode.jpattern.orm.query
Class Expression

java.lang.Object
  extended by com.googlecode.jpattern.orm.query.Expression
All Implemented Interfaces:
IExpression, IExpressionElement, INameSolverConsumer, IRenderableSqlObject

public class Expression
extends Object
implements IExpression

Author:
Francesco Cina 19/giu/2011

Constructor Summary
Expression()
           
 
Method Summary
 IExpression allEq(Map<String,Object> propertyMap)
          All Equal - Map containing property names and their values.
 IExpression and(IExpressionElement expressionOne, IExpressionElement expressionTwo)
          And - join two expressions with a logical and.
 void appendValues(List<Object> values)
          Append to the list all the values of the expression's elements
 IExpression eq(String property, Object value)
          Express the "Equals to" relation between an object's property and a fixed value.
 IExpression eqProperties(String firstProperty, String secondProperty)
          Express the "Equals to" relation between objects properties
 IExpression ge(String property, Object value)
          Express the "Greater or equals to" relation between an object's property and a fixed value.
 IExpression geProperties(String firstProperty, String secondProperty)
          Express the "Greater or equals to" relation between objects properties
 IExpression gt(String property, Object value)
          Express the "Greater than" relation between an object's property and a fixed value.
 IExpression gtProperties(String firstProperty, String secondProperty)
          Express the "Greater than" relation between objects properties
 IExpression ieq(String property, String 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).
 IExpression ieqProperties(String firstProperty, String secondProperty)
          Express the "Insensitive Equal To" bbetween objects properties (it uses a lower() function to make both case insensitive).
 IExpression ilike(String property, String value)
          Case insensitive Like - property like value where the value contains the SQL wild card characters % (percentage) and _ (underscore).
 IExpression in(String property, Collection<?> values)
          In - property has a value in the collection of values.
 IExpression in(String property, IQuery subQuery)
          In - using a subQuery.
 IExpression in(String property, Object[] values)
          In - property has a value in the array of values.
 IExpression isNotNull(String property)
          Is Not Null - property is not null.
 IExpression isNull(String property)
          Is Null - property is null.
 IExpression le(String property, Object value)
          Express the "Lesser or equals to" relation between an object's property and a fixed value.
 IExpression leProperties(String firstProperty, String secondProperty)
          Express the "Lesser or equals to" relation between objects properties
 IExpression like(String property, String value)
          Like - property like value where the value contains the SQL wild card characters % (percentage) and _ (underscore).
 IExpression lt(String property, Object value)
          Express the "Lesser than" relation between an object's property and a fixed value.
 IExpression ltProperties(String firstProperty, String secondProperty)
          Express the "Lesser than" relation between objects properties
 IExpression ne(String property, Object value)
          Express the "Not Equals to" relation between objects properties.
 IExpression neProperties(String firstProperty, String secondProperty)
          Express the "Not Equals to" relation between an object's property and a fixed value.
 IExpression nin(String property, Collection<?> values)
          Not In - property has a value in the collection of values.
 IExpression nin(String property, IQuery subQuery)
          Not In - using a subQuery.
 IExpression nin(String property, Object[] values)
          Not In - property has a value in the array of values.
 IExpression nlike(String property, String value)
          Not Like - property like value where the value contains the SQL wild card characters % (percentage) and _ (underscore).
 IExpression not(IExpressionElement expression)
          Negate the expression (prefix it with NOT).
 IExpression or(IExpressionElement expressionOne, IExpressionElement expressionTwo)
          Or - join two expressions with a logical or.
 String renderSql()
          Return the sql query generated by this IQuery Object
 void renderSql(StringBuilder StringBuilder)
          Append to the string buffer the sql query generated by this IQuery Object
 void setNameSolver(INameSolver nameSolver)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Expression

public Expression()
Method Detail

allEq

public IExpression allEq(Map<String,Object> propertyMap)
Description copied from interface: IExpression
All Equal - Map containing property names and their values.

Specified by:
allEq in interface IExpression
Returns:

eq

public IExpression eq(String property,
                      Object value)
Description copied from interface: IExpression
Express the "Equals to" relation between an object's property and a fixed value.

Specified by:
eq in interface IExpression
Returns:

eqProperties

public IExpression eqProperties(String firstProperty,
                                String secondProperty)
Description copied from interface: IExpression
Express the "Equals to" relation between objects properties

Specified by:
eqProperties in interface IExpression
Returns:

le

public IExpression le(String property,
                      Object value)
Description copied from interface: IExpression
Express the "Lesser or equals to" relation between an object's property and a fixed value.

Specified by:
le in interface IExpression
Returns:

leProperties

public IExpression leProperties(String firstProperty,
                                String secondProperty)
Description copied from interface: IExpression
Express the "Lesser or equals to" relation between objects properties

Specified by:
leProperties in interface IExpression
Returns:

ge

public IExpression ge(String property,
                      Object value)
Description copied from interface: IExpression
Express the "Greater or equals to" relation between an object's property and a fixed value.

Specified by:
ge in interface IExpression
Returns:

geProperties

public IExpression geProperties(String firstProperty,
                                String secondProperty)
Description copied from interface: IExpression
Express the "Greater or equals to" relation between objects properties

Specified by:
geProperties in interface IExpression
Returns:

lt

public IExpression lt(String property,
                      Object value)
Description copied from interface: IExpression
Express the "Lesser than" relation between an object's property and a fixed value.

Specified by:
lt in interface IExpression
Returns:

ltProperties

public IExpression ltProperties(String firstProperty,
                                String secondProperty)
Description copied from interface: IExpression
Express the "Lesser than" relation between objects properties

Specified by:
ltProperties in interface IExpression
Returns:

gt

public IExpression gt(String property,
                      Object value)
Description copied from interface: IExpression
Express the "Greater than" relation between an object's property and a fixed value.

Specified by:
gt in interface IExpression
Returns:

gtProperties

public IExpression gtProperties(String firstProperty,
                                String secondProperty)
Description copied from interface: IExpression
Express the "Greater than" relation between objects properties

Specified by:
gtProperties in interface IExpression
Returns:

ieq

public IExpression ieq(String property,
                       String value)
Description copied from interface: IExpression
Express the "Insensitive Equal To" between an object's property and a fixed value (it uses a lower() function to make both case insensitive).

Specified by:
ieq in interface IExpression
Returns:

ieqProperties

public IExpression ieqProperties(String firstProperty,
                                 String secondProperty)
Description copied from interface: IExpression
Express the "Insensitive Equal To" bbetween objects properties (it uses a lower() function to make both case insensitive).

Specified by:
ieqProperties in interface IExpression
Returns:

ilike

public IExpression ilike(String property,
                         String value)
Description copied from interface: IExpression
Case insensitive Like - property like value where the value contains the SQL wild card characters % (percentage) and _ (underscore).

Specified by:
ilike in interface IExpression
Returns:

in

public IExpression in(String property,
                      Collection<?> values)
Description copied from interface: IExpression
In - property has a value in the collection of values.

Specified by:
in in interface IExpression
Returns:

in

public IExpression in(String property,
                      Object[] values)
Description copied from interface: IExpression
In - property has a value in the array of values.

Specified by:
in in interface IExpression
Returns:

in

public IExpression in(String property,
                      IQuery subQuery)
Description copied from interface: IExpression
In - using a subQuery.

Specified by:
in in interface IExpression
Returns:

nin

public IExpression nin(String property,
                       Collection<?> values)
Description copied from interface: IExpression
Not In - property has a value in the collection of values.

Specified by:
nin in interface IExpression
Returns:

nin

public IExpression nin(String property,
                       Object[] values)
Description copied from interface: IExpression
Not In - property has a value in the array of values.

Specified by:
nin in interface IExpression
Returns:

nin

public IExpression nin(String property,
                       IQuery subQuery)
Description copied from interface: IExpression
Not In - using a subQuery.

Specified by:
nin in interface IExpression
Returns:

isNotNull

public IExpression isNotNull(String property)
Description copied from interface: IExpression
Is Not Null - property is not null.

Specified by:
isNotNull in interface IExpression
Returns:

isNull

public IExpression isNull(String property)
Description copied from interface: IExpression
Is Null - property is null.

Specified by:
isNull in interface IExpression
Returns:

like

public IExpression like(String property,
                        String value)
Description copied from interface: IExpression
Like - property like value where the value contains the SQL wild card characters % (percentage) and _ (underscore).

Specified by:
like in interface IExpression

nlike

public IExpression nlike(String property,
                         String value)
Description copied from interface: IExpression
Not Like - property like value where the value contains the SQL wild card characters % (percentage) and _ (underscore).

Specified by:
nlike in interface IExpression

ne

public IExpression ne(String property,
                      Object value)
Description copied from interface: IExpression
Express the "Not Equals to" relation between objects properties.

Specified by:
ne in interface IExpression
Returns:

neProperties

public IExpression neProperties(String firstProperty,
                                String secondProperty)
Description copied from interface: IExpression
Express the "Not Equals to" relation between an object's property and a fixed value.

Specified by:
neProperties in interface IExpression
Returns:

not

public IExpression not(IExpressionElement expression)
Description copied from interface: IExpression
Negate the expression (prefix it with NOT).

Specified by:
not in interface IExpression
Returns:

or

public IExpression or(IExpressionElement expressionOne,
                      IExpressionElement expressionTwo)
Description copied from interface: IExpression
Or - join two expressions with a logical or.

Specified by:
or in interface IExpression
Returns:

and

public IExpression and(IExpressionElement expressionOne,
                       IExpressionElement expressionTwo)
Description copied from interface: IExpression
And - join two expressions with a logical and.

Specified by:
and in interface IExpression
Returns:

setNameSolver

public void setNameSolver(INameSolver nameSolver)
Specified by:
setNameSolver in interface INameSolverConsumer

renderSql

public String renderSql()
Description copied from interface: IRenderableSqlObject
Return the sql query generated by this IQuery Object

Specified by:
renderSql in interface IRenderableSqlObject
Returns:

renderSql

public void renderSql(StringBuilder StringBuilder)
Description copied from interface: IRenderableSqlObject
Append to the string buffer the sql query generated by this IQuery Object

Specified by:
renderSql in interface IRenderableSqlObject

appendValues

public void appendValues(List<Object> values)
Description copied from interface: IExpressionElement
Append to the list all the values of the expression's elements

Specified by:
appendValues in interface IExpressionElement


Copyright © 2011. All Rights Reserved.