use of org.teiid.translator.coherence.visitor.DeleteVisitor in project teiid by teiid.
the class CoherenceUpdateExecution method executeDelete.
private void executeDelete() throws TranslatorException {
DeleteVisitor visitor = new DeleteVisitor(metadata);
visitor.visitNode((Delete) command);
if (visitor.getException() != null) {
throw visitor.getException();
}
if (visitor.getKeys() == null || visitor.getKeys().isEmpty()) {
// $NON-NLS-1$
final String msg = CoherencePlugin.Util.getString("CoherenceUpdateExecution.objectNotDeleted", new Object[] { visitor.getTableName() });
throw new TranslatorException(msg);
}
for (java.util.Iterator it = visitor.getKeys().iterator(); it.hasNext(); ) {
Object key = it.next();
try {
this.connection.remove(key);
} catch (ResourceException e) {
throw new TranslatorException(e);
}
}
}
Aggregations