You have to define the signature at one end of the relationship using a Collection. 
That is, either

// one customer has many addresses
public abstract Collection getAddresses();
public abstract void setAddressses( Collection addresses );

or

// one address is used by many customers
public abstract Collection getCustomers();
public abstract void setCustomers( Collection customers );



>>> Westlin Peter <[EMAIL PROTECTED]> 07/09/02 10:15AM >>>
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 
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED] 
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