Class ASTCurrentTimestamp
java.lang.Object
org.apache.cayenne.exp.Expression
org.apache.cayenne.exp.parser.SimpleNode
org.apache.cayenne.exp.parser.EvaluatedNode
org.apache.cayenne.exp.parser.ASTFunctionCall
org.apache.cayenne.exp.parser.ASTCurrentTimestamp
- All Implemented Interfaces:
Serializable, Node, XMLSerializable
- Since:
- 4.0
- See Also:
-
Field Summary
Fields inherited from class ASTFunctionCall
functionNameFields inherited from class SimpleNode
children, id, parentFields inherited from class Expression
ADD, ALL, AND, ANY, ASTERISK, BETWEEN, BITWISE_AND, BITWISE_LEFT_SHIFT, BITWISE_NOT, BITWISE_OR, BITWISE_RIGHT_SHIFT, BITWISE_XOR, CASE_WHEN, CUSTOM_OP, DB_PATH, DBID_PATH, DIVIDE, ELSE, ENCLOSING_OBJECT, EQUAL_TO, EXISTS, FALSE, FULL_OBJECT, FUNCTION_CALL, GREATER_THAN, GREATER_THAN_EQUAL_TO, IN, LESS_THAN, LESS_THAN_EQUAL_TO, LIKE, LIKE_IGNORE_CASE, LIST, MULTIPLY, NEGATIVE, NOT, NOT_BETWEEN, NOT_EQUAL_TO, NOT_EXISTS, NOT_IN, NOT_LIKE, NOT_LIKE_IGNORE_CASE, OBJ_PATH, OR, PRUNED_NODE, SCALAR, SUBQUERY, SUBTRACT, THEN, TRUE, type, WHENModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intExpression describes a path relative to a DbEntity.static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intInterpreted as a comma-separated list of literals.static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intExpression describes a path relative to an ObjEntity.static final intstatic final ObjectA value that a Transformer might return to indicate that a node has to be pruned from the expression during the transformation.static final intstatic final intstatic final intstatic final intstatic final intprotected intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectevaluateSubNode(Object o, Object[] evaluatedChildren) protected intbooleanCreates a copy of this expression node, without copying children.Methods inherited from class ASTFunctionCall
appendAsEJBQL, appendAsString, appendFunctionNameAsString, equals, getExpressionOperator, getFunctionName, getType, hashCode, nameToCamelCase, setFunctionNameModifier and TypeMethodDescriptionvoidappendAsEJBQL(List<Object> parameterAccumulator, Appendable out, String rootId) Stores a String representation of Expression as EJBQL using a provided PrintWriter.voidappendAsString(Appendable out) Appends own content as a String to the provided Appendable.protected voidbooleanprotected StringgetExpressionOperator(int index) intgetType()Returns a type of expression.inthashCode()protected static StringnameToCamelCase(String functionName) protected voidsetFunctionName(String functionName) Methods inherited from class EvaluatedNode
evaluateNodeModifier and TypeMethodDescriptionprotected ObjectEvaluates itself with object, pushing result on the stack.Methods inherited from class SimpleNode
appendAsEJBQL, appendAsEscapedString, appendChildrenAsEJBQL, appendScalarAsString, connectChildren, encodeScalarAsEJBQL, evaluate, evaluateChild, exists, expName, flattenTree, getEJBQLExpressionOperator, getOperand, getOperandCount, getPathAliases, isValidParent, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, notExists, notExp, numericToString, pruneNodeForPrunedChild, setOperand, unwrapChild, wrapChildModifier and TypeMethodDescriptionvoidappendAsEJBQL(Appendable out, String rootId) Stores a String representation of Expression as EJBQL using a provided Appendable.protected static voidappendAsEscapedString(Appendable out, String source) Utility method that prints a string to the provided Appendable, escaping special characters.protected voidappendChildrenAsEJBQL(List<Object> parameterAccumulator, Appendable out, String rootId) Encodes child of this node with specified index to EJBQLprotected static voidappendScalarAsString(Appendable out, Object scalar, char quoteChar) Utility method that encodes an object that is not an expression Node to String.protected voidSets the parent to this for all children.protected static voidencodeScalarAsEJBQL(List<Object> parameterAccumulator, Appendable out, Object scalar) This is a utility method that can represent the supplied scalar as either an EJBQL literal into the suppliedPrintWriteror is able to add the scalar to the parameters and to instead write a positional parameter to the EJBQL written to thePrintWriter.Calculates expression value with object as a context for path expressions.protected ObjectevaluateChild(int index, Object o) exists()Returns expression that will be dynamically resolved to proper subqueries based on a relationships used (if no relationships are present in the original expression no subqueries will be used).expName()Implemented for backwards compatibility with exp package.protected voidFlattens the tree under this node by eliminating any children that are of the same class as this node and copying their children to this node.protected StringgetEJBQLExpressionOperator(int index) Returns operator for EJBQL statements, which can differ for Cayenne expression operatorgetOperand(int index) Returns a value of operand atindex.intReturns a count of operands of this expression.Always returns empty map.protected booleanAdditional parent check that we can't handle properly in the grammar By default it just returns true.voidjjtAddChild(Node n, int i) This method tells the node to add its argument to the node's list of children.voidjjtClose()Called after all the child nodes have been added.jjtGetChild(int i) This method returns a child node.final intReturn the number of children the node has.voidjjtOpen()Called after the node has been made the current node.voidjjtSetParent(Node n) This pair of methods are used to inform the node of its parent.Returns expression that will be dynamically resolved to proper subqueries based on a relationships used (if no relationships are present in the original expression no subqueries will be used).notExp()Returns a logical NOT of current expression.protected static StringnumericToString(Number number) protected booleanpruneNodeForPrunedChild(Object prunedChild) Returns true if this node should be pruned from expression tree in the event a child is removed.voidsetOperand(int index, Object value) Sets a value of operand atindex.protected ObjectunwrapChild(Node child) protected NodeMethods inherited from class Expression
andExp, andExp, deepCopy, encodeAsXML, filter, filterObjects, first, joinExp, joinExp, match, orExp, orExp, params, params, paramsArray, setType, toEJBQL, toEJBQL, toString, transform, transformExpression, traverse, traverseModifier and TypeMethodDescriptionandExp(Expression exp) Chains this expression with another expression using "and".andExp(Expression exp, Expression... expressions) Chains this expression with other expressions using "and".deepCopy()Clones this expression.voidencodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor delegate) Encodes itself, wrapping the string into XML CDATA section.<T> Collection<?> filter(Collection<T> source, Collection<T> target) Adds objects matching this expression from the source collection to the target collection.<T> List<T> filterObjects(Collection<T> objects) Returns a list of objects that match the expression.<T> TReturns the first object in the list that matches the expression.joinExp(int type, Expression exp) Creates a new expression that joins this object with another expression, using specified join type.joinExp(int type, Expression exp, Expression... expressions) Creates a new expression that joins this object with other expressions, using specified join type.booleanCalculates expression boolean value with object as a context for path expressions.orExp(Expression exp) Chains this expression with another expression using "or".orExp(Expression exp, Expression... expressions) Chains this expression with other expressions using "or".Creates and returns a new Expression instance based on this expression, but with named parameters substituted with provided values.Creates and returns a new Expression instance based on this expression, but with named parameters substituted with provided values.If any subexpressions containing parameters not matching the "name" argument are found, the behavior depends on "pruneMissing" argument.paramsArray(Object... parameters) Creates and returns a new Expression instance based on this expression, but with parameters substituted with provided values.voidsetType(int type) Produces an EJBQL string that represents this expression.Produces an EJBQL string that represents this expression.toString()Creates a transformed copy of this expression, applying transformation provided by Transformer to all its nodes.protected ObjecttransformExpression(Function<Object, Object> transformer) A recursive method called from "transform" to do the actual transformation.protected voidtraverse(Expression parentExp, TraversalHandler visitor) Traverses itself and child expressions, notifying visitor via callback methods as it goes.voidtraverse(TraversalHandler visitor) Traverses itself and child expressions, notifying visitor via callback methods as it goes.
-
Constructor Details
-
ASTCurrentTimestamp
public ASTCurrentTimestamp()
-
-
Method Details
-
needParenthesis
public boolean needParenthesis()- Overrides:
needParenthesisin classASTFunctionCall
-
getRequiredChildrenCount
protected int getRequiredChildrenCount()- Specified by:
getRequiredChildrenCountin classEvaluatedNode
-
evaluateSubNode
- Specified by:
evaluateSubNodein classEvaluatedNode- Throws:
Exception
-
shallowCopy
Description copied from class:ExpressionCreates a copy of this expression node, without copying children.- Specified by:
shallowCopyin classExpression
-