/** */ public Object newConstructor(int line, int column, String className, List args) { ConstructorNode node = new ConstructorNode(className); node.setConstructorItems(args); setPosition(node, line, column); return node; }
/** * Check the specific constructor class and return its class instance. * @exception JPQLException if the specified constructor class could not * be found. */ private Class getConstructorClass(ParseTreeContext context) { Object type = getType(); if (type == null) { throw JPQLException.constructorClassNotFound( context.getQueryInfo(), getLine(), getColumn(), className); } return (Class)type; }
/** * INTERNAL * Apply this node to the passed query */ public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context) { if (theQuery instanceof ReportQuery) { SelectGenerationContext selectContext = (SelectGenerationContext)context; ReportQuery reportQuery = (ReportQuery)theQuery; reportQuery.beginAddingConstructorArguments( getConstructorClass(context.getParseTreeContext())); for (Iterator i = constructorItems.iterator(); i.hasNext();) { Node node = (Node)i.next(); if (selectingRelationshipField(node, context)) { selectContext.useOuterJoins(); } node.applyToQuery(reportQuery, context); selectContext.dontUseOuterJoins(); } reportQuery.endAddingToConstructorItem(); } }
/** * INTERNAL * Returns true if the specified expr is a valid SELECT clause expression. */ private boolean isValidSelectExpr(Node expr) { if (expr.isAggregateNode()) { return true; } else if (expr.isConstructorNode()) { List args = ((ConstructorNode)expr).getConstructorItems(); for (Iterator i = args.iterator(); i.hasNext(); ) { Node arg = (Node)i.next(); if (!isValidSelectExpr(arg)) { return false; } } return true; } return isGroupbyItem(expr); }
/** * INTERNAL * Validate node and calculate its type. */ public void validate(ParseTreeContext context) { for (Iterator i = constructorItems.iterator(); i.hasNext();) { Node item = (Node)i.next(); item.validate(context); } // Resolve constructor class TypeHelper typeHelper = context.getTypeHelper(); Object type = typeHelper.resolveTypeName(className); if (type == null) { String name = className; // check for inner classes int index = name.lastIndexOf('.'); if (index != -1) { name = name.substring(0, index) + '$' + name.substring(index+1); type = typeHelper.resolveTypeName(name); } } setType(type); }
/** * INTERNAL * Apply this node to the passed query */ public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context) { if (theQuery instanceof ReportQuery) { SelectGenerationContext selectContext = (SelectGenerationContext)context; ReportQuery reportQuery = (ReportQuery)theQuery; reportQuery.beginAddingConstructorArguments( getConstructorClass(context.getParseTreeContext())); for (Iterator i = constructorItems.iterator(); i.hasNext();) { Node node = (Node)i.next(); if (selectingRelationshipField(node, context)) { selectContext.useOuterJoins(); } node.applyToQuery(reportQuery, context); selectContext.dontUseOuterJoins(); } reportQuery.endAddingToConstructorItem(); } }
List args = ((ConstructorNode)node).getConstructorItems(); for (Iterator i = args.iterator(); i.hasNext();) { Node arg = (Node)i.next();
/** * INTERNAL * Validate node and calculate its type. */ public void validate(ParseTreeContext context) { for (Iterator i = constructorItems.iterator(); i.hasNext();) { Node item = (Node)i.next(); item.validate(context); } // Resolve constructor class TypeHelper typeHelper = context.getTypeHelper(); Object type = typeHelper.resolveTypeName(className); if (type == null) { String name = className; // check for inner classes int index = name.lastIndexOf('.'); if (index != -1) { name = name.substring(0, index) + '$' + name.substring(index+1); type = typeHelper.resolveTypeName(name); } } setType(type); }
/** * Check the specifid constructor class and return its class instance. * @exception JPQLException if the specified constructor class could not * be found. */ private Class getConstructorClass(ParseTreeContext context) { Object type = getType(); if (type == null) { throw JPQLException.constructorClassNotFound( context.getQueryInfo(), getLine(), getColumn(), className); } return (Class)type; }
/** */ public Object newConstructor(int line, int column, String className, List args) { ConstructorNode node = new ConstructorNode(className); node.setConstructorItems(args); setPosition(node, line, column); return node; }
/** * INTERNAL * Apply this node to the passed query */ public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context) { if (theQuery instanceof ReportQuery) { SelectGenerationContext selectContext = (SelectGenerationContext)context; ReportQuery reportQuery = (ReportQuery)theQuery; reportQuery.beginAddingConstructorArguments( getConstructorClass(context.getParseTreeContext())); for (Iterator i = constructorItems.iterator(); i.hasNext();) { Node node = (Node)i.next(); if (selectingRelationshipField(node, context)) { selectContext.useOuterJoins(); } node.applyToQuery(reportQuery, context); selectContext.dontUseOuterJoins(); } reportQuery.endAddingToConstructorItem(); } }
List args = ((ConstructorNode)node).getConstructorItems(); for (Iterator i = args.iterator(); i.hasNext();) { Node arg = (Node)i.next();
/** * INTERNAL * Validate node and calculate its type. */ public void validate(ParseTreeContext context) { for (Iterator i = constructorItems.iterator(); i.hasNext();) { Node item = (Node)i.next(); item.validate(context); } // Resolve constructor class TypeHelper typeHelper = context.getTypeHelper(); Object type = typeHelper.resolveTypeName(className); if (type == null) { String name = className; // check for inner classes int index = name.lastIndexOf('.'); if (index != -1) { name = name.substring(0, index) + '$' + name.substring(index+1); type = typeHelper.resolveTypeName(name); } } setType(type); }
/** * Check the specific constructor class and return its class instance. * @exception JPQLException if the specified constructor class could not * be found. */ private Class getConstructorClass(ParseTreeContext context) { Object type = getType(); if (type == null) { throw JPQLException.constructorClassNotFound( context.getQueryInfo(), getLine(), getColumn(), className); } return (Class)type; }
/** */ public Object newConstructor(int line, int column, String className, List args) { ConstructorNode node = new ConstructorNode(className); node.setConstructorItems(args); setPosition(node, line, column); return node; }
List args = ((ConstructorNode)node).getConstructorItems(); for (Iterator i = args.iterator(); i.hasNext();) { Node arg = (Node)i.next();