Heiko,

thanks very much for your help!

> Is there a specific reason, why you create the mapping table
> 'by hand' and not let the app server do it for you?

No, there isn�t. I was going to do this purely because the book I mentioned
in my previous mail recommended this approach.  Does that mean that Xdoclet
creates the mapping bean for me automatically.   I�m not quite sure what the
collection would return?  Sorry if I�m asking silly questions, but I�m
fairly new to the whole thing with no one to guide me except for my lovely
book and google :-) !

> and then
>   @jboss.target-relation
> fk-column="id"
> related-pk-field="customerIdFk"

Ok, I can see where I�m going wrong now!

> Try to use a n:m mapping directly a la:
>
>      * @jboss.relation-mapping style="relation-table"
>      *
>      *   --- this next one points to the fields of the
>      *   --- 'opposite side' of the relaton.
>      * @jboss.relation
>      *  related-pk-field="drinkPK"
>      *  fk-column="drinkID"
>
>
> For both sides of the relation in ProfileBean and CustomerBean

Ah, I�m beginning to understand how it works!  Thanks again.

Regards,

Michael



----- Original Message -----
From: "Rupp,Heiko" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 03, 2003 12:17 PM
Subject: RE: [Xdoclet-user] Need help with relationship error....


> Hello Michael,
>
> > I have a CustomerProfieBean in which the code you quoted
> > below resides.  I
> > want to create an m-n relationship with a ProfileBean and a
> > CustomerBean.
> > In the book "Mastering EJB" it is recommended to create a
> > third EJB with two
> > 1-n relationships to accomodate this.  In my case it is the
> > CustomerProfileBean.
>
> Is there a specific reason, why you create the mapping table
> 'by hand' and not let the app server do it for you?
>
>
> > My CustomerProfileBean holds the foreign key "profileIdFk"
> > and I want it to
> > relate to the field "id" in my ProfileBean.  The same goes
> > for the customer
> > relation (i.e. CustomerProfileBean.customerIdFk -> CustomerBean.id).
>
> So in CustomerProfileBean
> you would have
>  String customerIdFk
>
> and then
>   @jboss.target-relation
> fk-column="id"
> related-pk-field="customerIdFk"
>
> The same for CPB -> Profile
>
> > Should my "@jboss.relation" thus display something else?
>
> Is the profile_id_fk present in the profile bean?
>
> > I.e. perhaps the
> > field of the Profile rather than that of the CustomerProfile.
>
> Try to use a n:m mapping directly a la:
>
>      * @jboss.relation-mapping style="relation-table"
>      *
>      *   --- this next one points to the fields of the
>      *   --- 'opposite side' of the relaton.
>      * @jboss.relation
>      *  related-pk-field="drinkPK"
>      *  fk-column="drinkID"
>
>
> For both sides of the relation in ProfileBean and CustomerBean
>
>  HTH
>    Heiko
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: ValueWeb:
> Dedicated Hosting for just $79/mo with 500 GB of bandwidth!
> No other company gives more support or power for your dedicated server
> http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
> _______________________________________________
> xdoclet-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user
>



-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to