@Override public final C subquery(boolean s) { if (s) { subquery++; // [#7222] If present the nested set operations flag needs to be reset whenever we're // entering a subquery (and restored when leaving it). // [#2791] This works differently from the scope marking mechanism, which wraps a // [#7152] naming scope for aliases and other object names. if (TRUE.equals(data(DATA_NESTED_SET_OPERATIONS))) { data().remove(DATA_NESTED_SET_OPERATIONS); if (subqueryScopedNestedSetOperations == null) subqueryScopedNestedSetOperations = new BitSet(); subqueryScopedNestedSetOperations.set(subquery); } } else { if (subqueryScopedNestedSetOperations != null && subqueryScopedNestedSetOperations.get(subquery)) data(DATA_NESTED_SET_OPERATIONS, true); else data().remove(DATA_NESTED_SET_OPERATIONS); subquery--; } return (C) this; }
/** * Emit a clause from a query part being visited. * <p> * This method returns a clause to emit as a surrounding event before / * after visiting a query part. This is needed for all reusable query parts, * whose clause type is ambiguous at the container site. An example: * <p> * <code><pre>SELECT * FROM [A CROSS JOIN B]</pre></code> * <p> * The type of the above <code>JoinTable</code> modelling * <code>A CROSS JOIN B</code> is not known to the surrounding * <code>SELECT</code> statement, which only knows {@link Table} types. The * {@link Clause#TABLE_JOIN} event that is required to be emitted around the * {@link Context#visit(QueryPart)} event has to be issued here in * <code>AbstractContext</code>. */ private final Clause[] clause(QueryPart part) { if (part instanceof QueryPartInternal && data(DATA_OMIT_CLAUSE_EVENT_EMISSION) == null) return ((QueryPartInternal) part).clauses(this); return null; }
/** * Emit a clause from a query part being visited. * <p> * This method returns a clause to emit as a surrounding event before / * after visiting a query part. This is needed for all reusable query parts, * whose clause type is ambiguous at the container site. An example: * <p> * <code><pre>SELECT * FROM [A CROSS JOIN B]</pre></code> * <p> * The type of the above <code>JoinTable</code> modelling * <code>A CROSS JOIN B</code> is not known to the surrounding * <code>SELECT</code> statement, which only knows {@link Table} types. The * {@link Clause#TABLE_JOIN} event that is required to be emitted around the * {@link Context#visit(QueryPart)} event has to be issued here in * <code>AbstractContext</code>. */ private final Clause[] clause(QueryPart part) { if (part instanceof QueryPartInternal && data(DATA_OMIT_CLAUSE_EVENT_EMISSION) == null) { return ((QueryPartInternal) part).clauses(this); } return null; }