Mensaje citado por Jean-philippe VIGNIEL <[EMAIL PROTECTED]>:

  
 1-n relation:
          

      /**       @ejb.relation
       *     name = "Source-Target"
       *     role-name = "Source"
       *
       *     target-ejb = "Target"
       *     target-role-name = "Target"
        *    targte-multiple = "yes"
       *   /
    public abstract Collection getTarget();
    public abstract void setTarget(Collection target) 
    

Would't this be a m-n relationship?

  
 I don't think so, but as i said earlier, i'm far to be a specialist and i've never used a m-n relation (So i can be wrong).
For me,this xdoclet code generate a One to Many relation within the ejb-jar.xml that is to say the first multiplicity tag set to One and the second set to Many. I don't know how to generate a Many to Many relation.
In this case, according to the EJB specification (p130), the cardinality of the source can be more than one. That is to say that if you have the following  set of relation:
    A1 -> B1
    A1 -> B2

    A2 -> B3
And you want to add a new relation A2->B1 the relation A1->B1 is cut and the result is:
A1->B2

A2->B3
A2->B1


Jean-Philippe


Reply via email to