[Acceleo]Need OCL expert Trick! [message #548715] |
Thu, 22 July 2010 17:30 |
|
Hi all,
I read the entire Acceleo and ocl spec, and tried to make my own template.
I just need one more thing to complete it, but I'm not able to find the solution.
I want to generate text only one time when facing one or more *ToMany Association.
For example, importing java.util.Collection when got a toMany relationship.
I tried this:
[if(c.getAssociations().memberEnd->select(p:Property | p.upper <> 1).type->excluding(self)->size() > 0)]
import java.util.Collection;
[/if]
But it fails when I got a reflexive Association (Collection is not printed due to the excluding(self) condition).
Is there a way to solve this?
The ideal would be to know when i'm facing oneToMany relationship or manyToMany relationship, for example, importing javax.annotation.OneToMany or javax.annotation.ManyToMany depending the association upper's opposite.
Thank you in advance, Charlie
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03795 seconds