/** * PUBLIC: Call a constructor for the given class with the results of this query. * @param constructorClass * @param constructorArgTypes - sets the argument types to be passed to the constructor. */ public ConstructorReportItem beginAddingConstructorArguments(Class constructorClass, Class[] constructorArgTypes){ ConstructorReportItem citem =beginAddingConstructorArguments(constructorClass); citem.setConstructorArgTypes(constructorArgTypes); return citem; }
/** * PUBLIC: Call a constructor for the given class with the results of this query. * @param constructorClass * @param constructorArgTypes - sets the argument types to be passed to the constructor. */ public ConstructorReportItem beginAddingConstructorArguments(Class constructorClass, Class[] constructorArgTypes){ ConstructorReportItem citem =beginAddingConstructorArguments(constructorClass); citem.setConstructorArgTypes(constructorArgTypes); return citem; }
/** * PUBLIC: Call a constructor for the given class with the results of this query. * @param constructorClass * @param constructorArgTypes - sets the argument types to be passed to the constructor. */ public ConstructorReportItem beginAddingConstructorArguments(Class constructorClass, Class[] constructorArgTypes){ ConstructorReportItem citem =beginAddingConstructorArguments(constructorClass); citem.setConstructorArgTypes(constructorArgTypes); return citem; }
/** * 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(); } }
/** * {@inheritDoc} */ @Override public void visit(ConstructorExpression expression) { Class<?> type = queryContext.getType(expression.getClassName()); query.beginAddingConstructorArguments(type); expression.accept(constructorExpressionVisitor()); query.endAddingToConstructorItem(); }
/** * 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 * 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(); } }
/** * {@inheritDoc} */ @Override public void visit(ConstructorExpression expression) { Class<?> type = queryContext.getType(expression.getClassName()); query.beginAddingConstructorArguments(type); expression.accept(constructorExpressionVisitor()); query.endAddingToConstructorItem(); }