Class PatternMatchExp
java.lang.Object
org.apache.cayenne.exp.Expression
org.apache.cayenne.exp.ConditionExp
org.apache.cayenne.exp.PatternMatchExp
- All Implemented Interfaces:
XMLSerializable
- Direct Known Subclasses:
LikeExp, LikeIgnoreCaseExp, NotLikeExp, NotLikeIgnoreCaseExp
public abstract sealed class PatternMatchExp
extends ConditionExp
permits LikeExp, NotLikeExp (not exhaustive)
Superclass of pattern matching nodes. Assumes that subclass is a binary expression with
the second operand being a pattern.
- Since:
- 5.0
-
Field Summary
FieldsFields inherited from class Expression
operands, PRUNED_NODE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPatternMatchExp(Object... operands) This method will return an escape character for the like clause. -
Method Summary
Modifier and TypeMethodDescriptioncharprotected Patternabstract booleanprotected booleanmatchPattern(String string) voidsetEscapeChar(char value) This method allows the setting of the escape character.voidsetOperand(int index, Object value) Sets a value of operand atindex, growing the operands array if needed.Methods inherited from class ConditionExp
evaluateNode, evaluateSubNode, exists, getRequiredChildrenCount, isValidParent, notExistsMethods inherited from class Expression
andExp, andExp, appendAsString, appendOperandAsString, deepCopy, encodeAsXML, equals, evaluate, evaluateOperand, expName, filter, filterObjects, first, flattenTree, getExpressionOperator, getOperand, getOperandCount, getPathAliases, hashCode, match, notExp, orExp, orExp, params, params, paramsArray, parenthesizeAsOperand, pruneNodeForPrunedChild, setOperands, shallowCopy, toString, transform, transformExpression, traverse, traverse
-
Field Details
-
pattern
-
patternCompiled
protected boolean patternCompiled -
escapeChar
protected char escapeChar
-
-
Constructor Details
-
PatternMatchExp
This method will return an escape character for the like clause. The escape character will eventually end up in the query as
...(t0.foo LIKE ? {escape '|'})where the pipe symbol is the escape character.Note that having no escape character is represented as the character 0.
-
-
Method Details
-
getEscapeChar
public char getEscapeChar() -
setEscapeChar
public void setEscapeChar(char value) This method allows the setting of the escape character. The escape character can be used in a LIKE clause. The character 0 signifies no escape character. The escape character '?' is disallowed.
-
isIgnoringCase
public abstract boolean isIgnoringCase() -
matchPattern
-
getPattern
-
setOperand
Description copied from class:ExpressionSets a value of operand atindex, growing the operands array if needed. Operand indexing starts at 0. APersistentis replaced with its ObjectId. A nested expression is asked first whether this node is a valid parent for it, seeExpression.isValidParent(Expression).- Overrides:
setOperandin classExpression
-