use of org.teiid.query.sql.LanguageVisitor in project teiid by teiid.
the class QueryRewriter method removeAlias.
/**
* For backwards compatibility we strip the alias from delete/update
* @param command
* @param group
*/
private void removeAlias(ProcedureContainer command, GroupSymbol group) {
AliasGenerator ag = new AliasGenerator(true);
ag.setCorrelationGroups(Arrays.asList(group.getDefinition()));
command.acceptVisitor(ag);
final GroupSymbol clone = group.clone();
DeepPostOrderNavigator.doVisit(command, new LanguageVisitor() {
public void visit(GroupSymbol obj) {
if (obj.equals(clone) && obj.getMetadataID() == group.getMetadataID()) {
obj.setName(obj.getDefinition());
obj.setDefinition(null);
}
}
});
}
Aggregations