|
Re: automatic assignment of generated UUID to attribute with property ID=true [intrinsic] [message #530656 is a reply to message #530655] |
Fri, 30 April 2010 12:39 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
You could use EcoreUtil.setID or logic just like it uses.
KW wrote:
> hi,
>
> I would like to set an attribute of modeled class with the provided
> UUID after one overrides the ResourceFactory/XMIResourceImpl + method
> useUUIDs return true.
>
> How can this be achieved? I assume overriding the setId-method is a
> solution. if so, how can one get find the feature which property ID is
> set to true? Like:
>
> public void setID(EObject eObject, String id) {
>
>
> super.setID(eObject, id);
>
> EList<EStructuralFeature> feat =
> eObject.eClass().getEAllStructuralFeatures();
>
> for(EStructuralFeature f : feat){
> if(f.isID()){
> //set the id to this feature ...
> //somehow...
> }
> }
>
> }
>
> However, there is no isID() method - only methods like isUnique(),
> isMany() etc.
>
> Thanks
> Kris
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02582 seconds