Sorry, must have been very confused when I mailed this...
You are so right Chris. I have experimented with one-to-many also thats why the code I 
sent looked like it did. I sent the wrong code, sorry.
I'll try Collection to see if it works. Of course I should have thought of that myself 
but my mind was racing :)
 
Thanks
Weasel

-----Ursprungligt meddelande----- 
Fr�n: Shaw, Chris [mailto:[EMAIL PROTECTED]] 
Skickat: ti 2002-07-09 16:49 
Till: [EMAIL PROTECTED] 
Kopia: 
�mne: RE: [Xdoclet-user] Relations, many-to-one bidirectional



Hi, 

Some questions back.... 

If one Address can belong to more than one customer then 
how does the getCustomer() method know which customer to get when your 
signature is a single CustomerLocal object? 

Also you mention that one address belongs to many customers but the mapping 
name you chose is "customer-has-many-addresses" 
So there is a little bit of confusion here.... 

Try experimenting with java.util.Collection as your signature instead and 
see if you have more success.... 

Maybe you want a many-to-many instead? 

Regards 

Chris 
-=-=-= 

-----Original Message----- 
From: Westlin Peter [mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ] 
Sent: 09 July 2002 16:15 
To: [EMAIL PROTECTED] 
Subject: [Xdoclet-user] Relations, many-to-one bidirectional 


Hi! 
I'm testing CMR relations in Xdoclet (I love this tool) and have a couple of 
questions: 
With tags do I use when I want a "many-to-one" relation? 
I use the classic Customer-Address as a test and I want one Address to 
belong to many customers. 
In my CustomerBean I have: 
    /** 
     * @ejb:interface-method view-type="local" 
     * 
     * @ejb:relation 
     * name="customer-address" 
     * role-name="customer-has-many-addresses" 
     * 
   * @weblogic:column-map 
   *    foreign-key-column="FK_ADDRESS" 
   *    key-column="ID" 
   * 
     */ 
    public abstract test.ejb.AddressLocal getAddress(); 

and in AddressBean: 
    /** 
     * @ejb:interface-method view-type="local" 
     * 
     * @ejb:relation 
     * name="customer-address" 
     * role-name="address-has-one-customer" 
     */ 
   public abstract test.ejb.CustomerLocal getCustomer(); 

I have tried with target-ejb and target-multiple (though the docs say that 
these tags shall not be used in bidirectional relationship) on both sides of 
the relation but I always get: 
<multiplicity>One</multiplicity> 
in my ejb-jar.xml... 
  
I use the latest src from cvs. 
  
Regards 
Weasel 


------------------------------------------------------- 
This sf.net email is sponsored by:ThinkGeek 
Stuff, things, and much much more. 
http://thinkgeek.com/sf <http://thinkgeek.com/sf>  
_______________________________________________ 
Xdoclet-user mailing list 
[EMAIL PROTECTED] 
https://lists.sourceforge.net/lists/listinfo/xdoclet-user 
<https://lists.sourceforge.net/lists/listinfo/xdoclet-user>  

Any e-mail message from the European Central Bank (ECB) is sent in good faith but 
shall neither be binding nor construed as constituting a commitment by the ECB except 
where provided for in a written agreement.

This e-mail is intended only for the use of the recipient(s) named above. Any 
unauthorised disclosure, use or dissemination, either in whole or in part, is 
prohibited.

If you have received this e-mail in error, please notify the sender immediately via 
e-mail and delete this e-mail from your system.



------------------------------------------------------- 
This sf.net email is sponsored by:ThinkGeek 
Stuff, things, and much much more. 
http://thinkgeek.com/sf <http://thinkgeek.com/sf>  
_______________________________________________ 
Xdoclet-user mailing list 
[EMAIL PROTECTED] 
https://lists.sourceforge.net/lists/listinfo/xdoclet-user 
<https://lists.sourceforge.net/lists/listinfo/xdoclet-user>  



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Stuff, things, and much much more.
http://thinkgeek.com/sf
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to