FileDocCategorySizeDatePackage
LengthNode.javaAPI DocGlassfish v2 API3172Tue May 22 16:54:38 BST 2007oracle.toplink.essentials.internal.parsing

LengthNode

public class LengthNode extends StringFunctionNode
INTERNAL

Purpose: Used to resolve the LENGTH Function in EJBQL

Responsibilities:

  • Generate the correct expression for a LENGTH in EJBQL
author
Jon Driscoll and Joel Lucuik
since
TopLink 4.0

Fields Summary
Constructors Summary
public LengthNode()
LengthNode constructor comment.

        super();
    
Methods Summary
public oracle.toplink.essentials.expressions.ExpressiongenerateExpression(oracle.toplink.essentials.internal.parsing.GenerationContext context)
INTERNAL Generate the TopLink expression for this node

        Expression whereClause = getLeft().generateExpression(context);
        whereClause = whereClause.length();
        return whereClause;
    
public voidvalidate(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)
INTERNAL Validate the current node and calculates its type.

        TypeHelper typeHelper = context.getTypeHelper();
        if (left != null) {
            left.validate(context);
            left.validateParameter(context, typeHelper.getStringType());
        }
        setType(typeHelper.getIntType());