i have an EMF model where some objects contain IDs, and others don't. The id attribute is configured like this:
I use the java Diagnostician to check if any of the OCL Constraints are violated:
protected Diagnostic validateModel(EObject modelRoot) {
return Diagnostician.INSTANCE.validate(modelRoot);
}
Which works just fine in most cases. But as soon as there are duplicate Ids the Validator throws a ClassCastException, where he tries to cast one of the two objects to the type of the other. What can i do to aviod this? Would an OCL constraint that checks for duplicate Ids help somehow?