@Override protected boolean isOrderExpressionResultVariableRef(AST orderExpressionNode) throws SemanticException { // ORDER BY is not supported in a subquery // TODO: should an exception be thrown if an ORDER BY is in a subquery? if ( !isSubQuery() && orderExpressionNode.getType() == IDENT && selectExpressionsByResultVariable.containsKey( orderExpressionNode.getText() ) ) { return true; } return false; }
@Override protected void setAlias(AST selectExpr, AST ident) { ( (SelectExpression) selectExpr ).setAlias( ident.getText() ); // only put the alias (i.e., result variable) in selectExpressionsByResultVariable // if is not defined in a subquery. if ( !isSubQuery() ) { selectExpressionsByResultVariable.put( ident.getText(), (SelectExpression) selectExpr ); } }
@Override protected void handleResultVariableRef(AST resultVariableRef) throws SemanticException { if ( isSubQuery() ) { throw new SemanticException( "References to result variables in subqueries are not supported." ); } ( (ResultVariableRefNode) resultVariableRef ).setSelectExpression( selectExpressionsByResultVariable.get( resultVariableRef.getText() ) ); }
private boolean isCorrelatedSubselect() { return getWalker().isSubQuery() && getFromElement().getFromClause() != getWalker().getCurrentFromClause(); }
@Override protected void prepareFromClauseInputTree(AST fromClauseInput) { if ( !isSubQuery() ) {
elem.setImpliedInFromClause( true ); if ( elem.getWalker().isSubQuery() ) {
if ( fromElement.getWalker().isSubQuery() ) {
AST with) throws SemanticException { boolean fetch = fetchNode != null; if ( fetch && isSubQuery() ) { throw new QueryException( "fetch not allowed in subquery from-elements" );
@Override protected boolean isOrderExpressionResultVariableRef(AST orderExpressionNode) throws SemanticException { // ORDER BY is not supported in a subquery // TODO: should an exception be thrown if an ORDER BY is in a subquery? if ( ! isSubQuery() && orderExpressionNode.getType() == IDENT && selectExpressionsByResultVariable.containsKey( orderExpressionNode.getText() ) ) { return true; } return false; }
@Override protected boolean isOrderExpressionResultVariableRef(AST orderExpressionNode) throws SemanticException { // ORDER BY is not supported in a subquery // TODO: should an exception be thrown if an ORDER BY is in a subquery? if ( ! isSubQuery() && orderExpressionNode.getType() == IDENT && selectExpressionsByResultVariable.containsKey( orderExpressionNode.getText() ) ) { return true; } return false; }
@Override protected void handleResultVariableRef(AST resultVariableRef) throws SemanticException { if ( isSubQuery() ) { throw new SemanticException( "References to result variables in subqueries are not supported." ); } ( ( ResultVariableRefNode ) resultVariableRef ).setSelectExpression( selectExpressionsByResultVariable.get( resultVariableRef.getText() ) ); }
@Override protected void handleResultVariableRef(AST resultVariableRef) throws SemanticException { if ( isSubQuery() ) { throw new SemanticException( "References to result variables in subqueries are not supported." ); } ( ( ResultVariableRefNode ) resultVariableRef ).setSelectExpression( selectExpressionsByResultVariable.get( resultVariableRef.getText() ) ); }
@Override protected void setAlias(AST selectExpr, AST ident) { ((SelectExpression) selectExpr).setAlias(ident.getText()); // only put the alias (i.e., result variable) in selectExpressionsByResultVariable // if is not defined in a subquery. if ( ! isSubQuery() ) { selectExpressionsByResultVariable.put( ident.getText(), ( SelectExpression ) selectExpr ); } }
@Override protected void setAlias(AST selectExpr, AST ident) { ((SelectExpression) selectExpr).setAlias(ident.getText()); // only put the alias (i.e., result variable) in selectExpressionsByResultVariable // if is not defined in a subquery. if ( ! isSubQuery() ) { selectExpressionsByResultVariable.put( ident.getText(), ( SelectExpression ) selectExpr ); } }
private boolean isCorrelatedSubselect() { return getWalker().isSubQuery() && getFromElement().getFromClause() != getWalker().getCurrentFromClause(); }
private boolean isCorrelatedSubselect() { return getWalker().isSubQuery() && getFromElement().getFromClause() != getWalker().getCurrentFromClause(); }
elem.setImpliedInFromClause( true ); if ( elem.getWalker().isSubQuery() ) {
elem.setImpliedInFromClause( true ); if ( elem.getWalker().isSubQuery() ) {
AST with) throws SemanticException { boolean fetch = fetchNode != null; if ( fetch && isSubQuery() ) { throw new QueryException( "fetch not allowed in subquery from-elements" );
AST with) throws SemanticException { boolean fetch = fetchNode != null; if ( fetch && isSubQuery() ) { throw new QueryException( "fetch not allowed in subquery from-elements" );