I am using xdoclet with the weblogic subtask. One of my beans has a
unidirectional m:1 relationship with another bean.

The generated weblogic-cmp-rdbms-jar.xml file is not correct. The hiccup
comes from this relationship being m:1, not 1:m, and the wrong role in the
relationship is being listed.

I am wondering if I am doing something wrong or whether this is a bug.


Here is my javadoc tag (note that I've included both column-map and
target-column-map, though target-column-map is being ignored):

    /**
     * 
     * 
     * @ejb:interface-method
     * @ejb:relation
     *  name="Magazine-Subscriber-Relation"
     *  target-multiple="yes"
     *  role-name="Subscriber-has-Mag"
     *  target-ejb="Magazine"
     *  target-role-name="Mag-for-Subscriber"
     * @weblogic:relation
     * @weblogic:column-map
     *  key-column="id"
     *  foreign-key-column="subscriberId"
     * @weblogic:target-column-map
     *  key-column="id"
     *  foreign-key-column="magazineId"
    **/
    public abstract test.relation.ejb.MagazineLocal getMag();


Here is the snippet from the generated weblogic-cmp-rbdms-jar.xml file:

  <weblogic-rdbms-relation>
      <relation-name>Magazine-Subscriber-Relation</relation-name>
      <weblogic-relationship-role>
         <relationship-role-name>Mag-for-Subscriber</relationship-role-name>

         <column-map>
            <foreign-key-column>subscriberId</foreign-key-column>
            <key-column>id</key-column>
         </column-map>
      </weblogic-relationship-role>
   </weblogic-rdbms-relation>


Here is the corresponding ejbc error:

ERROR: Error from ejbc: Error while reading
'META-INF/weblogic-cmp-rdbms-jar.xml'. The error was:

In relationship Magazine-Subscriber-Relation, the <ejb-relationship-role>,
Subscriber-has-Mag, defined in ejb-jar.xml must have a corresponding
<weblogic-relationship-role> in the RDBMS CMP deployment descriptor file
with the same name.




The dtd for weblogic-cmp-rbdms-jar.xml states the following about
weblogic-rdbms-relation:

For one-to-many relations, the physical mapping is also always from a
foreign key in one bean to the primary key of another. In a one-to-many
relation, the foreign key is always contained in the role that occupies the
'many' side of the relation. Thus, the specification of the
relationship-role-name below is a bit redundant, but is included for
uniformity.

So in the unidirectional m:1 relationship, it seems to me that the required
xdoclet tag should be:

    /**
     * 
     * 
     * @ejb:interface-method
     * @ejb:relation
     *  name="Magazine-Subscriber-Relation"
     *  target-multiple="yes"
     *  role-name="Subscriber-has-Mag"
     *  target-ejb="Magazine"
     *  target-role-name="Mag-for-Subscriber"
     * @weblogic:relation
     * @weblogic:target-column-map
     *  key-column="id"
     *  foreign-key-column="magazineId"
    **/
    public abstract test.relation.ejb.MagazineLocal getMag();

Which should generate the following:

  <weblogic-rdbms-relation>
      <relation-name>Magazine-Subscriber-Relation</relation-name>
      <weblogic-relationship-role>
         <relationship-role-name>Subscriber-has-Mag</relationship-role-name>

         <column-map>
            <foreign-key-column>magazineId</foreign-key-column>
            <key-column>id</key-column>
         </column-map>
      </weblogic-relationship-role>
   </weblogic-rdbms-relation>


Thanks in advance,
Andy



-------------------------------------------------------
This sf.net email is sponsored by: viaVerio will pay you up to
$1,000 for every account that you consolidate with us.
http://ad.doubleclick.net/clk;4749864;7604308;v?
http://www.viaverio.com/consolidator/osdn.cfm
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to