com.jpattern.orm.query.clause
Class OrmWhere<T extends Where<?>>

java.lang.Object
  extended by com.jpattern.orm.query.SmartRenderableSqlSubElement
      extended by com.jpattern.orm.query.clause.OrmWhere<T>
All Implemented Interfaces:
SqlClause<T>, Where<T>, NameSolverConsumer, RenderableSqlSubElement
Direct Known Subclasses:
CustomFindWhereImpl, DeleteWhereImpl, FindWhereImpl, UpdateWhereImpl

public abstract class OrmWhere<T extends Where<?>>
extends SmartRenderableSqlSubElement
implements Where<T>, NameSolverConsumer

Author:
Francesco Cina 19/giu/2011

Constructor Summary
OrmWhere()
           
 
Method Summary
 T allEq(Map<String,Object> propertyMap)
          All Equal - Map containing property names and their values.
 T and(ExpressionElement... expressionElements)
          And - join more expressions with a logical and.
 T and(List<ExpressionElement> expressionElements)
          And - join more expressions with a logical and.
 void appendElementValues(List<Object> values)
          Append to the list all the values of the expression's elements
 void doElementRender(StringBuilder StringBuilder)
           
 T eq(String property, Object value)
          Express the "Equals to" relation between an object's property and a fixed value.
 T eqProperties(String firstProperty, String secondProperty)
          Express the "Equals to" relation between objects properties
 T ge(String property, Object value)
          Express the "Greater or equals to" relation between an object's property and a fixed value.
 T geProperties(String firstProperty, String secondProperty)
          Express the "Greater or equals to" relation between objects properties
 int getElementStatusVersion()
           
 T gt(String property, Object value)
          Express the "Greater than" relation between an object's property and a fixed value.
 T gtProperties(String firstProperty, String secondProperty)
          Express the "Greater than" relation between objects properties
 T 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).
 T ieqProperties(String firstProperty, String secondProperty)
          Express the "Insensitive Equal To" bbetween objects properties (it uses a lower() function to make both case insensitive).
 T ilike(String property, String value)
          Case insensitive Like - property like value where the value contains the SQL wild card characters % (percentage) and _ (underscore).
 T in(String property, BaseFindQuery subQuery)
          In - using a subQuery.
 T in(String property, Collection<?> values)
          In - property has a value in the collection of values.
 T in(String property, Object[] values)
          In - property has a value in the array of values.
 T isNotNull(String property)
          Is Not Null - property is not null.
 T isNull(String property)
          Is Null - property is null.
 T le(String property, Object value)
          Express the "Lesser or equals to" relation between an object's property and a fixed value.
 T leProperties(String firstProperty, String secondProperty)
          Express the "Lesser or equals to" relation between objects properties
 T like(String property, String value)
          Like - property like value where the value contains the SQL wild card characters % (percentage) and _ (underscore).
 T lt(String property, Object value)
          Express the "Lesser than" relation between an object's property and a fixed value.
 T ltProperties(String firstProperty, String secondProperty)
          Express the "Lesser than" relation between objects properties
 T ne(String property, Object value)
          Express the "Not Equals to" relation between objects properties.
 T neProperties(String firstProperty, String secondProperty)
          Express the "Not Equals to" relation between an object's property and a fixed value.
 T nin(String property, BaseFindQuery subQuery)
          Not In - using a subQuery.
 T nin(String property, Collection<?> values)
          Not In - property has a value in the collection of values.
 T nin(String property, Object[] values)
          Not In - property has a value in the array of values.
 T nlike(String property, String value)
          Not Like - property like value where the value contains the SQL wild card characters % (percentage) and _ (underscore).
 T not(ExpressionElement expression)
          Negate the expression (prefix it with NOT).
 T or(ExpressionElement... expressionElements)
          Or - join more expressions with a logical or.
 T or(List<ExpressionElement> expressionElements)
          Or - join more expressions with a logical or.
 void setNameSolver(NameSolver nameSolver)
           
protected abstract  T where()
           
 
Methods inherited from class com.jpattern.orm.query.SmartRenderableSqlSubElement
isElementStatusChanged, renderSqlElement, renderSqlElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrmWhere

public OrmWhere()
Method Detail

where

protected abstract T where()

allEq

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

Specified by:
allEq in interface Where<T extends Where<?>>
Returns:

eq

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

Specified by:
eq in interface Where<T extends Where<?>>
Returns:

eqProperties

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

Specified by:
eqProperties in interface Where<T extends Where<?>>
Returns:

le

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

Specified by:
le in interface Where<T extends Where<?>>
Returns:

leProperties

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

Specified by:
leProperties in interface Where<T extends Where<?>>
Returns:

ge

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

Specified by:
ge in interface Where<T extends Where<?>>
Returns:

geProperties

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

Specified by:
geProperties in interface Where<T extends Where<?>>
Returns:

lt

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

Specified by:
lt in interface Where<T extends Where<?>>
Returns:

ltProperties

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

Specified by:
ltProperties in interface Where<T extends Where<?>>
Returns:

gt

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

Specified by:
gt in interface Where<T extends Where<?>>
Returns:

gtProperties

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

Specified by:
gtProperties in interface Where<T extends Where<?>>
Returns:

ieq

public T ieq(String property,
             String value)
Description copied from interface: Where
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 Where<T extends Where<?>>
Returns:

ieqProperties

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

Specified by:
ieqProperties in interface Where<T extends Where<?>>
Returns:

ilike

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

Specified by:
ilike in interface Where<T extends Where<?>>
Returns:

in

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

Specified by:
in in interface Where<T extends Where<?>>
Returns:

in

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

Specified by:
in in interface Where<T extends Where<?>>
Returns:

in

public T in(String property,
            BaseFindQuery subQuery)
Description copied from interface: Where
In - using a subQuery.

Specified by:
in in interface Where<T extends Where<?>>
Returns:

nin

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

Specified by:
nin in interface Where<T extends Where<?>>
Returns:

nin

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

Specified by:
nin in interface Where<T extends Where<?>>
Returns:

nin

public T nin(String property,
             BaseFindQuery subQuery)
Description copied from interface: Where
Not In - using a subQuery.

Specified by:
nin in interface Where<T extends Where<?>>
Returns:

isNotNull

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

Specified by:
isNotNull in interface Where<T extends Where<?>>
Returns:

isNull

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

Specified by:
isNull in interface Where<T extends Where<?>>
Returns:

like

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

Specified by:
like in interface Where<T extends Where<?>>

nlike

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

Specified by:
nlike in interface Where<T extends Where<?>>

ne

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

Specified by:
ne in interface Where<T extends Where<?>>
Returns:

neProperties

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

Specified by:
neProperties in interface Where<T extends Where<?>>
Returns:

not

public T not(ExpressionElement expression)
Description copied from interface: Where
Negate the expression (prefix it with NOT).

Specified by:
not in interface Where<T extends Where<?>>
Returns:

or

public T or(ExpressionElement... expressionElements)
Description copied from interface: Where
Or - join more expressions with a logical or.

Specified by:
or in interface Where<T extends Where<?>>
Returns:

or

public T or(List<ExpressionElement> expressionElements)
Description copied from interface: Where
Or - join more expressions with a logical or.

Specified by:
or in interface Where<T extends Where<?>>
Returns:

and

public T and(ExpressionElement... expressionElements)
Description copied from interface: Where
And - join more expressions with a logical and.

Specified by:
and in interface Where<T extends Where<?>>
Returns:

and

public T and(List<ExpressionElement> expressionElements)
Description copied from interface: Where
And - join more expressions with a logical and.

Specified by:
and in interface Where<T extends Where<?>>
Returns:

setNameSolver

public void setNameSolver(NameSolver nameSolver)
Specified by:
setNameSolver in interface NameSolverConsumer

doElementRender

public final void doElementRender(StringBuilder StringBuilder)
Specified by:
doElementRender in class SmartRenderableSqlSubElement

appendElementValues

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

Specified by:
appendElementValues in interface RenderableSqlSubElement

getElementStatusVersion

public final int getElementStatusVersion()
Specified by:
getElementStatusVersion in class SmartRenderableSqlSubElement


Copyright © 2013. All Rights Reserved.