> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Hani
> Suleiman
> Sent: 27. januar 2003 15:53
> To: Aslak Helles�y
> Cc: Brian McSweeney; xdoclet
> Subject: RE: [Xdoclet-user] Directionality CMR Question
>
>
> This brings up a related issue I've been having trouble with...How would I
> handle the case where the relation PK is a compound primary key?
> Eg, if in the
> example below, Address has multiple PK fields. I can't specify multiple
> related-pk-field tag attributes, so what is the correct way of
> handling this?
>

Just use one
@jboss.relation or @weblogic.column-map tag for each related column.

These are tags that can be specified many times.

Enclosed is a little Middlegen screenshot to illustrate that Middlegen
supports this too ;-)

Aslak

> Quoting Aslak Helles�y <[EMAIL PROTECTED]>:
>
> > 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
> >
> >
>
>
>
>
>
>
> -------------------------------------------------------
> 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

<<attachment: compound.gif>>

Reply via email to