public void visit(DynamicCommand obj) { obj.setSql(replaceExpression(obj.getSql())); if (obj.getUsing() != null) { for (SetClause clause : obj.getUsing().getClauses()) { visit(clause); } } }
/** * @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()); }
public void visit(DynamicCommand obj) { obj.setSql(replaceExpression(obj.getSql())); if (obj.getUsing() != null) { for (SetClause clause : obj.getUsing().getClauses()) { visit(clause); } } }
public void visit(DynamicCommand obj) { obj.setSql(replaceExpression(obj.getSql())); if (obj.getUsing() != null) { for (SetClause clause : obj.getUsing().getClauses()) { visit(clause); } } }
/** * @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()); }
@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; }
@Override public Boolean requiresTransaction(boolean transactionalReads) { Boolean expressionRequires = SubqueryAwareRelationalNode.requiresTransaction(transactionalReads, ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(dynamicCommand.getSql())); if (expressionRequires != null && expressionRequires) { return true;
@Override public Boolean requiresTransaction(boolean transactionalReads) { Boolean expressionRequires = SubqueryAwareRelationalNode.requiresTransaction(transactionalReads, ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(dynamicCommand.getSql())); if (expressionRequires != null && expressionRequires) { return true;
/** * 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); }
/** * 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); }
String sqlType = DataTypeManager.getDataTypeName(dynamicCmd.getSql().getType()); String targetType = DataTypeManager.DefaultDataTypes.CLOB; throw new QueryResolverException(QueryPlugin.Event.TEIID30100, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30100, sqlType)); dynamicCmd.setSql(ResolverUtil.convertExpression(dynamicCmd.getSql(), targetType, metadata));
String sqlType = DataTypeManager.getDataTypeName(dynamicCmd.getSql().getType()); String targetType = DataTypeManager.DefaultDataTypes.CLOB; throw new QueryResolverException(QueryPlugin.Event.TEIID30100, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30100, sqlType)); dynamicCmd.setSql(ResolverUtil.convertExpression(dynamicCmd.getSql(), targetType, metadata));
/** * @see org.teiid.query.sql.lang.QueryCommand#clone() */ public Object clone() { DynamicCommand clone = new DynamicCommand(); clone.setSql((Expression)getSql().clone()); if (asColumns != null) { List<ElementSymbol> cloneColumns = LanguageObject.Util.deepClone(asColumns, ElementSymbol.class); clone.setAsColumns(cloneColumns); } if (intoGroup != null) { clone.setIntoGroup(intoGroup.clone()); } if (using != null) { clone.setUsing((SetClauseList)using.clone()); } clone.setUpdatingModelCount(getUpdatingModelCount()); copyMetadataState(clone); clone.setAsClauseSet(isAsClauseSet()); return clone; }
/** * @see org.teiid.query.sql.lang.QueryCommand#clone() */ public Object clone() { DynamicCommand clone = new DynamicCommand(); clone.setSql((Expression)getSql().clone()); if (asColumns != null) { List<ElementSymbol> cloneColumns = LanguageObject.Util.deepClone(asColumns, ElementSymbol.class); clone.setAsColumns(cloneColumns); } if (intoGroup != null) { clone.setIntoGroup(intoGroup.clone()); } if (using != null) { clone.setUsing((SetClauseList)using.clone()); } clone.setUpdatingModelCount(getUpdatingModelCount()); copyMetadataState(clone); clone.setAsClauseSet(isAsClauseSet()); return clone; }
/** * @see org.teiid.query.sql.lang.QueryCommand#clone() */ public Object clone() { DynamicCommand clone = new DynamicCommand(); clone.setSql((Expression)getSql().clone()); if (asColumns != null) { List<ElementSymbol> cloneColumns = LanguageObject.Util.deepClone(asColumns, ElementSymbol.class); clone.setAsColumns(cloneColumns); } if (intoGroup != null) { clone.setIntoGroup(intoGroup.clone()); } if (using != null) { clone.setUsing((SetClauseList)using.clone()); } clone.setUpdatingModelCount(getUpdatingModelCount()); copyMetadataState(clone); clone.setAsClauseSet(isAsClauseSet()); return clone; }
append(IMMEDIATE); append(SPACE); visitNode(obj.getSql());
append(IMMEDIATE); append(SPACE); visitNode(obj.getSql());
append(IMMEDIATE); append(SPACE); visitNode(obj.getSql());