|
Re: How to specify composed key in a reference [message #1823137 is a reply to message #1823124] |
Fri, 20 March 2020 04:23 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
You cannot use eKeys for this purpose. The EReference.eKeys plays two roles. It defines a constraint. In addition, that constraint is used for navigation by org.eclipse.emf.ecore.impl.BasicEObjectImpl.eURIFragmentSegment(EStructuralFeature, EObject) (when serializing) and by org.eclipse.emf.ecore.impl.BasicEObjectImpl.eObjectForURIFragmentPredicate(String, EReference) as called from org.eclipse.emf.ecore.impl.BasicEObjectImpl.eObjectForURIFragmentSegment(String) when resolving deserialized proxies.
If you need a more general/flexible constraint, you can define a named constraint or an invariant operation on the Instrument EClass and implement arbitrary constraint logic for that in the generated validator or the operation body. If you want it also used for navigation, you can specialize eURIFragmentSegment and eObjectForURIFragmentSegment, though that's unlikely to helpful because it's not a containment reference.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03359 seconds