I've been trying to describe a 1:n relationship from a customer to the 
customer's addresses with the following tags:

      * @ejb:interface-method view-type="local"
      * @ejb:relation
      *    name="addresses"
      *    role-name="one-customer-has-many-addresses"
      *    target-ejb="AddressBean"
      *    target-role-name="one-address-belongs-to-one-customer"
      *
      * @weblogic:relation
      *    target-foreign-key-column="customer_id"
      *    key-column="id"
      *


In XDoclet 1.1.1 this generates the following code 
in  weblogic-cmp-rdbms-jar.xml:

    <weblogic-rdbms-relation>
       <relation-name>addresses</relation-name>

       <weblogic-relationship-role>
          
<relationship-role-name>one-customer-has-many-addresses</relationship-role-name> 

          <column-map>
             <foreign-key-column>customer_id</foreign-key-column>
             <key-column>id</key-column>
          </column-map>
       </weblogic-relationship-role>

    </weblogic-rdbms-relation>



That is wrong because all relationships must have two 
<weblogic-relationship-role>:s. The correct xml would be:

    <weblogic-rdbms-relation>
       <relation-name>addresses</relation-name>

       <weblogic-relationship-role>
          
<relationship-role-name>one-address-belongs-to-one-customer</relationship-role-name> 

       </weblogic-relationship-role>
       <weblogic-relationship-role>
          
<relationship-role-name>one-customer-has-many-addresses</relationship-role-name> 

          <column-map>
             <foreign-key-column>customer_id</foreign-key-column>
             <key-column>id</key-column>
          </column-map>
       </weblogic-relationship-role>

    </weblogic-rdbms-relation>




Am I doing something wrong or is this a bug?

/Daniel


_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to