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

HavingNode

public class HavingNode extends MajorNode
INTERNAL

Purpose: This node represents a HAVING

Responsibilities:

  • Generate the correct expression for HAVING

Fields Summary
private Node
having
Constructors Summary
Methods Summary
public voidaddHavingToQuery(oracle.toplink.essentials.queryframework.ObjectLevelReadQuery theQuery, oracle.toplink.essentials.internal.parsing.GenerationContext context)
INTERNAL Add the having expression to the passed query

        if (theQuery.isReportQuery()) {
            Expression havingExpression = getHaving().generateExpression(context);
            ((ReportQuery)theQuery).setHavingExpression(havingExpression);
        }
    
public oracle.toplink.essentials.internal.parsing.NodegetHaving()
INTERNAL Return the HAVING expression

        return having;
    
public voidsetHaving(oracle.toplink.essentials.internal.parsing.Node having)
INTERNAL Set the HAVING expression

        this.having = having;
    
public voidvalidate(oracle.toplink.essentials.internal.parsing.ParseTreeContext context, oracle.toplink.essentials.internal.parsing.GroupByNode groupbyNode)
INTERNAL Validate the current node.


              
          
        if (having != null) {
            having.validate(context);
            
            if ((groupbyNode != null) && !groupbyNode.isValidHavingExpr(having)) {
                throw EJBQLException.invalidHavingExpression(
                    context.getQueryInfo(),  having.getLine(), having.getColumn(),
                    having.getAsString(), groupbyNode.getAsString());
            }
        }