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

Reply via email to