/** * @see org.teiid.query.sql.LanguageVisitor#visit(org.teiid.query.sql.lang.DynamicCommand) */ public void visit(DynamicCommand obj) { if (obj.getIntoGroup() != null) { validateInto(obj, obj.getAsColumns(), obj.getIntoGroup()); } if (obj.getUsing() != null) { validateSetClauseList(obj.getUsing()); } }
/** * @see org.teiid.query.sql.LanguageVisitor#visit(org.teiid.query.sql.lang.DynamicCommand) */ public void visit(DynamicCommand obj) { if (obj.getIntoGroup() != null) { validateInto(obj, obj.getAsColumns(), obj.getIntoGroup()); } if (obj.getUsing() != null) { validateSetClauseList(obj.getUsing()); } }
/** * @see org.teiid.query.sql.LanguageVisitor#visit(org.teiid.query.sql.lang.DynamicCommand) */ public void visit(DynamicCommand obj) { if (obj.getIntoGroup() != null) { validateInto(obj, obj.getAsColumns(), obj.getIntoGroup()); } if (obj.getUsing() != null) { validateSetClauseList(obj.getUsing()); } }
/** * NOTE: we specifically don't need to visit the as columns or the using identifiers. * These will be resolved by the dynamic command resolver instead. * * @see org.teiid.query.sql.LanguageVisitor#visit(org.teiid.query.sql.lang.DynamicCommand) */ public void visit(DynamicCommand obj) { preVisitVisitor(obj); visitNode(obj.getSql()); visitNode(obj.getIntoGroup()); if (obj.getUsing() != null) { for (SetClause setClause : obj.getUsing().getClauses()) { visitNode(setClause.getValue()); } } postVisitVisitor(obj); }
/** * NOTE: we specifically don't need to visit the as columns or the using identifiers. * These will be resolved by the dynamic command resolver instead. * * @see org.teiid.query.sql.LanguageVisitor#visit(org.teiid.query.sql.lang.DynamicCommand) */ public void visit(DynamicCommand obj) { preVisitVisitor(obj); visitNode(obj.getSql()); visitNode(obj.getIntoGroup()); if (obj.getUsing() != null) { for (SetClause setClause : obj.getUsing().getClauses()) { visitNode(setClause.getValue()); } } postVisitVisitor(obj); }
@Override public Boolean requiresTransaction(boolean transactionalReads) { Boolean expressionRequires = SubqueryAwareRelationalNode.requiresTransaction(transactionalReads, ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(dynamicCommand.getSql())); if (expressionRequires != null && expressionRequires) { return true; } if (this.dynamicCommand.getUsing() != null) { Boolean setRequires = SubqueryAwareRelationalNode.requiresTransaction(transactionalReads, ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(this.dynamicCommand.getUsing().getClauseMap().values())); if (setRequires == null) { if (expressionRequires == null) { return true; } expressionRequires = null; } else if (setRequires) { return true; } } if ((dynamicCommand.getUpdatingModelCount() < 2 && transactionalReads) || dynamicCommand.getUpdatingModelCount() == 1) { return expressionRequires==null?true:null; } if (dynamicCommand.getUpdatingModelCount() > 1) { return true; } return expressionRequires; }
/** * NOTE: we specifically don't need to visit the as columns or the using identifiers. * These will be resolved by the dynamic command resolver instead. * * @see org.teiid.query.sql.LanguageVisitor#visit(org.teiid.query.sql.lang.DynamicCommand) */ public void visit(DynamicCommand obj) { preVisitVisitor(obj); visitNode(obj.getSql()); visitNode(obj.getIntoGroup()); if (obj.getUsing() != null) { for (SetClause setClause : obj.getUsing().getClauses()) { visitNode(setClause.getValue()); } } postVisitVisitor(obj); }
/** * @param procEnv * @param localContext * @throws TeiidComponentException * @throws TeiidComponentException * @throws TeiidProcessingException */ private void updateContextWithUsingValues(ProcedurePlan procEnv, VariableContext localContext) throws TeiidComponentException, TeiidProcessingException { if (dynamicCommand.getUsing() != null && !dynamicCommand.getUsing().isEmpty()) { for (SetClause setClause : dynamicCommand.getUsing().getClauses()) { Object assignment = procEnv.evaluateExpression(setClause.getValue()); LogManager.logTrace(org.teiid.logging.LogConstants.CTX_DQP, new Object[] { this, " The using variable ", //$NON-NLS-1$ setClause.getSymbol(), " has value :", assignment }); //$NON-NLS-1$ localContext.setValue(setClause.getSymbol(), assignment); ElementSymbol es = setClause.getSymbol().clone(); es.getGroupSymbol().setShortName(Reserved.USING); localContext.setValue(es, assignment); } } }
/** * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DynamicCommand)) { return false; } DynamicCommand other = (DynamicCommand)obj; return this.updatingModelCount == other.updatingModelCount && EquivalenceUtil.areEqual(getAsColumns(), other.getAsColumns()) && EquivalenceUtil.areEqual(getSql(), other.getSql()) && EquivalenceUtil.areEqual(getIntoGroup(), other.getIntoGroup()) && EquivalenceUtil.areEqual(getUsing(), other.getUsing()); }
/** * @param procEnv * @param localContext * @throws TeiidComponentException * @throws TeiidComponentException * @throws TeiidProcessingException */ private void updateContextWithUsingValues(ProcedurePlan procEnv, VariableContext localContext) throws TeiidComponentException, TeiidProcessingException { if (dynamicCommand.getUsing() != null && !dynamicCommand.getUsing().isEmpty()) { for (SetClause setClause : dynamicCommand.getUsing().getClauses()) { Object assignment = procEnv.evaluateExpression(setClause.getValue()); LogManager.logTrace(org.teiid.logging.LogConstants.CTX_DQP, new Object[] { this, " The using variable ", //$NON-NLS-1$ setClause.getSymbol(), " has value :", assignment }); //$NON-NLS-1$ localContext.setValue(setClause.getSymbol(), assignment); ElementSymbol es = setClause.getSymbol().clone(); es.getGroupSymbol().setShortName(Reserved.USING); localContext.setValue(es, assignment); } } }
/** * @param procEnv * @param localContext * @throws TeiidComponentException * @throws TeiidComponentException * @throws TeiidProcessingException */ private void updateContextWithUsingValues(ProcedurePlan procEnv, VariableContext localContext) throws TeiidComponentException, TeiidProcessingException { if (dynamicCommand.getUsing() != null && !dynamicCommand.getUsing().isEmpty()) { for (SetClause setClause : dynamicCommand.getUsing().getClauses()) { Object assignment = procEnv.evaluateExpression(setClause.getValue()); LogManager.logTrace(org.teiid.logging.LogConstants.CTX_DQP, new Object[] { this, " The using variable ", //$NON-NLS-1$ setClause.getSymbol(), " has value :", assignment }); //$NON-NLS-1$ localContext.setValue(setClause.getSymbol(), assignment); ElementSymbol es = setClause.getSymbol().clone(); es.getGroupSymbol().setShortName(Reserved.USING); localContext.setValue(es, assignment); } } }
/** * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DynamicCommand)) { return false; } DynamicCommand other = (DynamicCommand)obj; return this.updatingModelCount == other.updatingModelCount && EquivalenceUtil.areEqual(getAsColumns(), other.getAsColumns()) && EquivalenceUtil.areEqual(getSql(), other.getSql()) && EquivalenceUtil.areEqual(getIntoGroup(), other.getIntoGroup()) && EquivalenceUtil.areEqual(getUsing(), other.getUsing()); }
/** * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DynamicCommand)) { return false; } DynamicCommand other = (DynamicCommand)obj; return this.updatingModelCount == other.updatingModelCount && EquivalenceUtil.areEqual(getAsColumns(), other.getAsColumns()) && EquivalenceUtil.areEqual(getSql(), other.getSql()) && EquivalenceUtil.areEqual(getIntoGroup(), other.getIntoGroup()) && EquivalenceUtil.areEqual(getUsing(), other.getUsing()); }
return true; if (this.dynamicCommand.getUsing() != null) { Boolean setRequires = SubqueryAwareRelationalNode.requiresTransaction(transactionalReads, ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(this.dynamicCommand.getUsing().getClauseMap().values())); if (setRequires == null) { if (expressionRequires == null) {
return true; if (this.dynamicCommand.getUsing() != null) { Boolean setRequires = SubqueryAwareRelationalNode.requiresTransaction(transactionalReads, ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(this.dynamicCommand.getUsing().getClauseMap().values())); if (setRequires == null) { if (expressionRequires == null) {