|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.exp.ExpressionFactory
public class ExpressionFactory
Helper class to build expressions. Alternatively expressions can be built using
Expression.fromString(String)
method.
Constructor Summary | |
---|---|
ExpressionFactory()
|
Method Summary | |
---|---|
static Expression |
betweenDbExp(String pathSpec,
Object value1,
Object value2)
A convenience shortcut for building BETWEEN expressions. |
static Expression |
betweenExp(String pathSpec,
Object value1,
Object value2)
A convenience shortcut for building BETWEEN expressions. |
static Expression |
expFalse()
A convenience shortcut for boolean false expression. |
static Expression |
expressionOfType(int type)
Creates a new expression for the type requested. |
static Expression |
expTrue()
A convenience shortcut for boolean true expression. |
static Expression |
greaterDbExp(String pathSpec,
Object value)
A convenience method to create an DB_PATH "greater than" expression. |
static Expression |
greaterExp(String pathSpec,
Object value)
A convenience method to create an OBJ_PATH "greater than" expression. |
static Expression |
greaterOrEqualDbExp(String pathSpec,
Object value)
A convenience method to create an DB_PATH "greater than or equal to" expression. |
static Expression |
greaterOrEqualExp(String pathSpec,
Object value)
A convenience method to create an OBJ_PATH "greater than or equal to" expression. |
static Expression |
inDbExp(String pathSpec,
Collection values)
A convenience shortcut for building IN DB expression. |
static Expression |
inDbExp(String pathSpec,
Object[] values)
A convenience shortcut for building IN DB expression. |
static Expression |
inExp(String pathSpec,
Collection values)
A convenience shortcut for building IN expression. |
static Expression |
inExp(String pathSpec,
Object[] values)
A convenience shortcut for building IN expression. |
static Expression |
joinExp(int type,
List expressions)
Joins all expressions in a single expression. |
static Expression |
lessDbExp(String pathSpec,
Object value)
A convenience method to create an DB_PATH "less than" expression. |
static Expression |
lessExp(String pathSpec,
Object value)
A convenience method to create an OBJ_PATH "less than" expression. |
static Expression |
lessOrEqualDbExp(String pathSpec,
Object value)
A convenience method to create an DB_PATH "less than or equal to" expression. |
static Expression |
lessOrEqualExp(String pathSpec,
Object value)
A convenience method to create an OBJ_PATH "less than or equal to" expression. |
static Expression |
likeDbExp(String pathSpec,
Object value)
A convenience shortcut for building LIKE DB_PATH expression. |
static Expression |
likeExp(String pathSpec,
Object value)
A convenience shortcut for building LIKE expression. |
static Expression |
likeIgnoreCaseDbExp(String pathSpec,
Object value)
A convenience shortcut for building LIKE_IGNORE_CASE expression. |
static Expression |
likeIgnoreCaseExp(String pathSpec,
Object value)
A convenience shortcut for building LIKE_IGNORE_CASE expression. |
static Expression |
matchAllDbExp(Map map,
int pairType)
Creates an expression that matches all key-values pairs in map . |
static Expression |
matchAllExp(Map map,
int pairType)
Creates an expression that matches all key-values pairs in map . |
static Expression |
matchAnyDbExp(Map map,
int pairType)
Creates an expression that matches any of the key-values pairs in map . |
static Expression |
matchAnyExp(Map map,
int pairType)
Creates an expression that matches any of the key-values pairs in the map . |
static Expression |
matchDbExp(String pathSpec,
Object value)
A convenience method to create an DB_PATH "equal to" expression. |
static Expression |
matchExp(String pathSpec,
Object value)
A convenience method to create an OBJ_PATH "equal to" expression. |
static Expression |
noMatchDbExp(String pathSpec,
Object value)
A convenience method to create an DB_PATH "not equal to" expression. |
static Expression |
noMatchExp(String pathSpec,
Object value)
A convenience method to create an OBJ_PATH "not equal to" expression. |
static Expression |
notBetweenDbExp(String pathSpec,
Object value1,
Object value2)
A convenience shortcut for building NOT_BETWEEN expressions. |
static Expression |
notBetweenExp(String pathSpec,
Object value1,
Object value2)
A convenience shortcut for building NOT_BETWEEN expressions. |
static Expression |
notInDbExp(String pathSpec,
Collection values)
A convenience shortcut for building NOT_IN expression. |
static Expression |
notInDbExp(String pathSpec,
Object[] values)
A convenience shortcut for building NOT_IN expression. |
static Expression |
notInExp(String pathSpec,
Collection values)
A convenience shortcut for building NOT_IN expression. |
static Expression |
notInExp(String pathSpec,
Object[] values)
A convenience shortcut for building NOT_IN expression. |
static Expression |
notLikeDbExp(String pathSpec,
Object value)
A convenience shortcut for building NOT_LIKE expression. |
static Expression |
notLikeExp(String pathSpec,
Object value)
A convenience shortcut for building NOT_LIKE expression. |
static Expression |
notLikeIgnoreCaseDbExp(String pathSpec,
Object value)
A convenience shortcut for building NOT_LIKE_IGNORE_CASE expression. |
static Expression |
notLikeIgnoreCaseExp(String pathSpec,
Object value)
A convenience shortcut for building NOT_LIKE_IGNORE_CASE expression. |
protected static Object |
wrapPathOperand(Object op)
Applies a few default rules for adding operands to expressions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExpressionFactory()
Method Detail |
---|
public static Expression expressionOfType(int type)
protected static Object wrapPathOperand(Object op)
public static Expression matchAnyDbExp(Map map, int pairType)
map
.
For each pair pairType
operator is used to build a binary
expression. Key is considered to be a DB_PATH expression. Therefore all keys must
be java.lang.String objects, or ClassCastException is thrown. OR is used to join
pair binary expressions.
public static Expression matchAllDbExp(Map map, int pairType)
map
.
For each pair pairType
operator is used to build a binary
expression. Key is considered to be a DB_PATH expression. Therefore all keys must
be java.lang.String objects, or ClassCastException is thrown. AND is used to join
pair binary expressions.
public static Expression matchAnyExp(Map map, int pairType)
map
.
For each pair pairType
operator is used to build a binary
expression. Key is considered to be a OBJ_PATH expression. Therefore all keys must
be java.lang.String objects, or ClassCastException is thrown. OR is used to join
pair binary expressions.
public static Expression matchAllExp(Map map, int pairType)
map
.
For each pair pairType
operator is used to build a binary
expression. Key is considered to be a OBJ_PATH expression. Therefore all keys must
be java.lang.String objects, or ClassCastException is thrown. AND is used to join
pair binary expressions.
public static Expression matchDbExp(String pathSpec, Object value)
public static Expression noMatchDbExp(String pathSpec, Object value)
public static Expression matchExp(String pathSpec, Object value)
public static Expression noMatchExp(String pathSpec, Object value)
public static Expression lessExp(String pathSpec, Object value)
public static Expression lessDbExp(String pathSpec, Object value)
public static Expression lessOrEqualExp(String pathSpec, Object value)
public static Expression lessOrEqualDbExp(String pathSpec, Object value)
public static Expression greaterExp(String pathSpec, Object value)
public static Expression greaterDbExp(String pathSpec, Object value)
public static Expression greaterOrEqualExp(String pathSpec, Object value)
public static Expression greaterOrEqualDbExp(String pathSpec, Object value)
public static Expression inExp(String pathSpec, Object[] values)
public static Expression inDbExp(String pathSpec, Object[] values)
public static Expression inExp(String pathSpec, Collection values)
public static Expression inDbExp(String pathSpec, Collection values)
public static Expression notInExp(String pathSpec, Collection values)
public static Expression notInDbExp(String pathSpec, Collection values)
public static Expression notInExp(String pathSpec, Object[] values)
public static Expression notInDbExp(String pathSpec, Object[] values)
public static Expression betweenExp(String pathSpec, Object value1, Object value2)
public static Expression betweenDbExp(String pathSpec, Object value1, Object value2)
public static Expression notBetweenExp(String pathSpec, Object value1, Object value2)
public static Expression notBetweenDbExp(String pathSpec, Object value1, Object value2)
public static Expression likeExp(String pathSpec, Object value)
public static Expression likeDbExp(String pathSpec, Object value)
public static Expression notLikeExp(String pathSpec, Object value)
public static Expression notLikeDbExp(String pathSpec, Object value)
public static Expression likeIgnoreCaseExp(String pathSpec, Object value)
public static Expression likeIgnoreCaseDbExp(String pathSpec, Object value)
public static Expression notLikeIgnoreCaseExp(String pathSpec, Object value)
public static Expression notLikeIgnoreCaseDbExp(String pathSpec, Object value)
public static Expression expTrue()
public static Expression expFalse()
public static Expression joinExp(int type, List expressions)
expressions
in a single expression. type
is
used as an expression type for expressions joining each one of the items on the
list. type
must be binary expression type.
For example, if type is Expression.AND, resulting expression would match all expressions in the list. If type is Expression.OR, resulting expression would match any of the expressions.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |