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

JoinDeclNode

public class JoinDeclNode extends IdentificationVariableDeclNode
INTERNAL

Purpose: Represent JOIN identification variable declaration as part of the FROM clause: JOIN c.orders o.

Responsibilities:

  • Manage the path node and the outer join flag of the JOIN clause.

Fields Summary
private Node
path
private boolean
outerJoin
Constructors Summary
Methods Summary
public oracle.toplink.essentials.internal.parsing.NodegetPath()

        return path;
    
public booleanisOuterJoin()

        return outerJoin;
    
public oracle.toplink.essentials.internal.parsing.NodequalifyAttributeAccess(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)
INTERNAL Check the path child node for an unqualified field access and if so, replace it by a qualified field access.

        if (path != null) {
            path = path.qualifyAttributeAccess(context);
        }
        return this;
    
public voidsetOuterJoin(boolean outerJoin)

        this.outerJoin = outerJoin;
    
public voidsetPath(oracle.toplink.essentials.internal.parsing.Node node)

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

        super.validate(context);
        if (path != null) {
            path.validate(context);
            setType(path.getType());

            // join of embedded attribute is not supported.
            if (path.isDotNode()) {
                TypeHelper typeHelper = context.getTypeHelper();
                VariableNode left = (VariableNode)path.getLeft();
                AttributeNode right = (AttributeNode)path.getRight(); 
                if ((left != null) && (right != null)) {
                    if (typeHelper.isEmbeddedAttribute(left.getType(), right.getAttributeName()))
                        throw EJBQLException.unsupportJoinArgument(
                            context.getQueryInfo(), getLine(), getColumn(), 
                            "Join", getType().toString());
                } 
            }
        }