@Override public void visit( Subquery subquery ) { subqueries.add(subquery); if (includeNestedSubqueries) { // Now look for any subqueries in the subquery ... subquery.getQuery().accept(this); } } });
@Override public void visit( Subquery subquery ) { subqueries.add(subquery); if (includeNestedSubqueries) { // Now look for any subqueries in the subquery ... subquery.getQuery().accept(this); } } });
/** * Validate the supplied query. * * @param context the context in which the query is being planned * @param query the set query to be planned * @param usedSelectors the map of {@link SelectorName}s (aliases or names) used in the query. */ protected void validate( QueryContext context, QueryCommand query, Map<SelectorName, Table> usedSelectors ) { // // Resolve everything ... // Visitors.visitAll(query, new Validator(context, usedSelectors)); // Resolve everything (except subqueries) ... Validator validator = new Validator(context, usedSelectors); query.accept(new WalkAllVisitor(validator) { @Override protected void enqueue( Visitable objectToBeVisited ) { if (objectToBeVisited instanceof Subquery) return; super.enqueue(objectToBeVisited); } }); }
/** * Validate the supplied query. * * @param context the context in which the query is being planned * @param query the set query to be planned * @param usedSelectors the map of {@link SelectorName}s (aliases or names) used in the query. */ protected void validate( QueryContext context, QueryCommand query, Map<SelectorName, Table> usedSelectors ) { // // Resolve everything ... // Visitors.visitAll(query, new Validator(context, usedSelectors)); // Resolve everything (except subqueries) ... Validator validator = new Validator(context, usedSelectors); query.accept(new WalkAllVisitor(validator) { @Override protected void enqueue( Visitable objectToBeVisited ) { if (objectToBeVisited instanceof Subquery) return; super.enqueue(objectToBeVisited); } }); }
@Override public void visit( Subquery subquery ) { append('('); subquery.getQuery().accept(this); append(')'); }
@Override public void visit( Subquery subquery ) { append('('); subquery.getQuery().accept(this); append(')'); }