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

RangeDeclNode

public class RangeDeclNode extends IdentificationVariableDeclNode
INTERNAL

Purpose: Represent a range identification variable declaration as part of the FROM clause FROM Order o.

Responsibilities:

  • Manage the abstract schema name range variable declaration.

Fields Summary
private String
abstractSchemaName
Constructors Summary
Methods Summary
public java.lang.StringgetAbstractSchemaName()

        return abstractSchemaName;
    
public oracle.toplink.essentials.internal.parsing.NodequalifyAttributeAccess(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)
INTERNAL Check for an unqualified field access. If abstractSchemaName does not define a valid abstract schema name treat it as unqualified field access. Then method qualifies the field access and use it as the path expression of a new join variable declaration node returned by the method.

        TypeHelper typeHelper = context.getTypeHelper();
        String name = abstractSchemaName;
        if (typeHelper.resolveSchema(name) == null) {
            // not a known abstract schema name => make it a join node with a
            // qualified attribute access as path expression 
            context.unregisterVariable(getCanonicalVariableName());
            NodeFactory factory = context.getNodeFactory();
            Node path = (Node)factory.newQualifiedAttribute(
                getLine(), getColumn(), context.getBaseVariable(), name);
            return (Node)factory.newVariableDecl(
                getLine(), getColumn(), path, getVariableName());
        }
        return this;
    
public voidsetAbstractSchemaName(java.lang.String name)

        abstractSchemaName = name;
    
public voidvalidate(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)
INTERNAL Validate node and calculate its type.

        super.validate(context);
        TypeHelper typeHelper = context.getTypeHelper();
        Object type = typeHelper.resolveSchema(abstractSchemaName);
        if (type == null) {
            throw EJBQLException.unknownAbstractSchemaType2(
                context.getQueryInfo(), getLine(), getColumn(), abstractSchemaName);
        }
        setType(type);