That looks ok. Why don't you try it and see if it works??

Aslak

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Brian
McSweeney
Sent: 27. januar 2003 11:57
To: xdoclet
Subject: [Xdoclet-user] Directionality CMR Question


Hi all,

I'm getting a bit confused with implementing my database design with ejb CMR
and xdoclet.
I have two beans A and B. Each of these beans have an address that I want to
factor out into
AddressEJB.

So I want it so that bean A and AddressEJB is 1-1,
and bean B and AddressEJB is also 1-1.

I think the right way to do this is making the relationships unidirectional,
ie, either A or B can
get back their AddressEJB, but the Address can't get back it's bean A or B.
I think this is the
right way to do it because otherwise the AddressEJB would have to have a get
method for both
A and B. However I'm not sure if it can be done at all.

I'd love some advice as to whether I'm going along the right way or not.
Here's what I'm thinking
about in terms of my xdoclet code.


Example of my xdoclet code for bean A.


    /**
     * @ejb.interface-method
     * @ejb.relation
     *      name="abean-address"
     *      role-name="abean-has-address"
     *      target-ejb="Address"
     *      target-role-name="address-belongs_to-abean"
     *      target-cascade-delete="yes"
     * @jboss.relation
     *      fk-column="addressId_fk"
     *      related-pk-field="addressId"
     */
    public abstract AddressLocal getAddress();
    public abstract void setAddress( AddressLocal address );


thanks very much,
Brian



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to