On Thu, 2003-07-17 at 13:27, Jean-philippe VIGNIEL wrote:
> Hi everybody
>
> I have to manage a n:1 relation ship between two entities, is it
> possible to generate the suitable ejb-jar by using the xdoclet
> ejb.relation tag?
> I've succeeded to specify a one to one relation but the only way i
> found to have a n to 1 relation was to set by hand the source
> <multiplicity> tag to Many.
> I hope i'm not alone to need such a relation.
For the case where you have Bean 1 having many Bean 2's, try this in
Bean 1 for the interface method that returns a Collection
@ejb.relation name="Bean1-Bean2"
role-name="Bean1-has-many-Bean2"
target-ejb="Bean2"
target-role-name="Bean2-belongs-to-Bean1"
target-cascade-delete="yes"
If you want the accessor on Bean2 then it would be something like this
in the interface method that returns an object
@ejb.relation name="Bean1-Bean2"
role-name="Bean2-belongs-to-Bean1"
cascade-delete="yes"
target-ejb="Bean1"
target-role-name="Bean1-has-many-Bean2"
target-multiple="true"
--
Andy
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user