Comparison compareCriteria = (Comparison)criteria;
if (compareCriteria.getOperator() != Operator.EQ) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaNotEqualsError"); //$NON-NLS-1$
throw new TranslatorException(msg);
}
Expression leftExpr = compareCriteria.getLeftExpression();
if (!(leftExpr instanceof ColumnReference)) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaLHSNotElementError"); //$NON-NLS-1$
throw new TranslatorException(msg);
}
// call utility method to get NameInSource/Name for element
String nameLeftExpr = getNameFromElement((ColumnReference)leftExpr);
if (!(nameLeftExpr.toUpperCase().equals("DN"))) { //$NON-NLS-1$
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaSrcColumnError",nameLeftExpr); //$NON-NLS-1$
throw new TranslatorException(msg);
}
Expression rightExpr = compareCriteria.getRightExpression();
if (!(rightExpr instanceof Literal)) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaRHSNotLiteralError"); //$NON-NLS-1$
throw new TranslatorException(msg);
}
Object valueRightExpr = ((Literal)rightExpr).getValue();