I see that this question has been asked in the lists before but doesn't seem
like it has been resolved, so I'm going to ask it again to see if there has
been any change in status.

I'm working through the O'Reilly EJB book and one of the examples is a
1-Many Uni-Directional CMR in which I do not know how to setup the tags to
get the correct "relationship-role-name" to appear in the weblogic xml. I
need the target role-name, which is "Phone-belongs-to-Customer", but the
CustomerBean role-name shows up as can be seen below.

I tried this both with the XDoclet1.2.0b1 build and a 12/30/2002 build from
the CVS xdoclet-all module. Here is the relevant information...

...CustomerBean...

    /**
    * This is a uni-directional one-to-many relationship
    *
    * @ejb.relation
    *    name="Customer-Phone"
    *    role-name="Customer-has-many-Phones"
    *    cascade-delete="no"
    *    target-ejb="Phone"
    *    target-role-name="Phone-belongs-to-Customer"
    *    target-cascade-delete="yes"
    *    target-multiple="no"
    *
    * Oracle 
    *    PHONES.CUSTOMER_ID
    *    CUSTOMER.ID
    *
    * @weblogic.column-map
    *    foreign-key-column="CUSTOMER_ID"
    *    key-column="ID"
    *
    * @ejb.interface-method
    * @ejb.transaction type="Supports"
    */
    public abstract java.util.Collection getPhoneNumbers( );

    Generates the following in weblogic-cmp-rdbms.xml...

   <weblogic-rdbms-relation>
      <relation-name>Customer-Phone</relation-name>
      <weblogic-relationship-role>

 
<relationship-role-name>Customer-has-many-Phones</relationship-role-name>
         <relationship-role-map>
         <column-map>
            <foreign-key-column>CUSTOMER_ID</foreign-key-column>
            <key-column>ID</key-column>
         </column-map>
         </relationship-role-map>
      </weblogic-relationship-role>
   </weblogic-rdbms-relation>


    Generates the following in ejb-jar.xml...

      <ejb-relation >
         <ejb-relation-name>Customer-Phone</ejb-relation-name>

         <ejb-relationship-role >
 
<ejb-relationship-role-name>Customer-has-many-Phones</ejb-relationship-role-
name>
            <multiplicity>One</multiplicity>
            <relationship-role-source >
               <ejb-name>Customer</ejb-name>
            </relationship-role-source>
            <cmr-field >
               <cmr-field-name>phoneNumbers</cmr-field-name>
               <cmr-field-type>java.util.Collection</cmr-field-type>
            </cmr-field>
         </ejb-relationship-role>

         <ejb-relationship-role >
 
<ejb-relationship-role-name>Phone-belongs-to-Customer</ejb-relationship-role
-name>
            <multiplicity>Many</multiplicity>
            <cascade-delete/>
            <relationship-role-source >
               <ejb-name>Phone</ejb-name>
            </relationship-role-source>
         </ejb-relationship-role>

      </ejb-relation>

Any help would be appreciated...
Tim Kuntz


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to