Hi all,

I'm using CMP 2.0 with Weblogic 6.1sp2 and the latest xdoclet 
distribution from CVS and have some problems with xdoclet and relationships.

Suppose I have two tables CUSTOMER

CUSTOMER_ID integer (primary key)
NAME varchar(50)
ADDRESS_ID integer (foreign key to ADDRESS)

and ADDRESS:

ADDRESS_ID integer (primary key)
STREET varchar(50)

Of course I have two entity beans CustomerBean and AddressBean and I 
need a one-to-one relation between them (one customer has exactly one 
address).

What I'd like are methods get/setAddress in CustomerBean to get/set the 
related Address. Follow some code from CustomerBean.java:

    /**
     * @ejb:relation name="Customer-Address"
     *               role-name="Customer-has-one-Address"
     *               target-ejb="Address"
     *               target-role-name="Address-belongs-to-Customer"
     *               target-multiple="no"
     *
     * @weblogic:column-map foreign-key-column="ADDRESS_ID"
     *                      key-column="ADDRESS_ID"
     */
    public abstract AddressLocal getAddress();
    public abstract void setAddress(AddressLocal request);

Now the problem: weblogic ejbc complains about a column-map containing 
an invalid key-column. I think this is explained by an extract of the 
generated weblogic-cmp-rdbms-jar.xml:

   <weblogic-rdbms-relation>
      <relation-name>Customer-Address</relation-name>
      <weblogic-relationship-role>
         
<relationship-role-name>Address-belongs-to-Customer</relationship-role-name>
         <column-map>
            <foreign-key-column>ADDRESS_ID</foreign-key-column>
            <key-column>ADDRESS_ID</key-column>
         </column-map>
      </weblogic-relationship-role>
   </weblogic-rdbms-relation>

The <relationship-role-name> generated by xdoclet is the 
target-role-name in @ejb:relation tag, but shouldn't it be role-name 
instead ? And
infact if I manually force the latter everything works ok!!

Looking at weblogic-cmp-rdbms-jar-xml.xdt I see that 
<XDtEjbRel:rightRoleName/> is always used, but maybe this time it should 
have been <XDtEjbRel:leftRoleName/>.

I'm going really crazy abot this, so any help would by really appreciated.

Marco




-------------------------------------------------------
This sf.net email is sponsored by: Jabber Inc.
Don't miss the IM event of the season | Special offer for OSDN members! 
JabConf 2002, Aug. 20-22, Keystone, CO http://www.jabberconf.com/osdn
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to