Hi

I am having a problem with <fk-constraint> appearing in the wrong location
when using the current CVS. When using XDoclet 1.1.2, the same XDoclet tags
work fine.

In EventBean:

 /**
   * An Event has many Competitions
   *
   * @ejb:relation
   *     name="Event-Competition"
   *     role-name="Event-has-many-Competitions"
   * @ejb:interface-method view-type="local"
   */
  public abstract Set getCompetitions();

  /**
   * @ejb:interface-method view-type="local"
   */
  public abstract void setCompetitions(Set competitions);

In CompetitionBean:

 /**
   * A Competition belongs to exactly one Event
   *
   * @ejb:relation
   *     name="Event-Competition"
   *     role-name="Competition-has-a-Event"
   *
   * @jboss:relation
   *     fk-column="event_fk"
   *     related-pk-field="id"
   *     fk-constraint="true"
   *
   * @ejb:interface-method  view-type="local"
   */
  public abstract  com.interfaces.EventLocal getEvent();

  /**
   * @ejb:interface-method view-type="local"
   */
  public abstract void setEvent(com.interfaces.EventLocal event);

With XDoclet 1.1.2, the output is:

    <ejb-relation>
      <ejb-relation-name>Event-Competition</ejb-relation-name>
      <foreign-key-mapping/>
      <ejb-relationship-role>

<ejb-relationship-role-name>Event-has-many-Competitions</ejb-relationship-ro
le-name>
          <key-fields>
             <key-field>
               <field-name>id</field-name>
               <column-name>event_fk</column-name>
             </key-field>
          </key-fields>
      </ejb-relationship-role>
      <ejb-relationship-role>

<ejb-relationship-role-name>Competition-has-a-Event</ejb-relationship-role-n
ame>
          <fk-constraint>true</fk-constraint>
          <key-fields/>
      </ejb-relationship-role>
    </ejb-relation>

With XDoclet from today's CVS, the output is:

      <ejb-relation-name>Event-Competition</ejb-relation-name>
      <foreign-key-mapping/>
      <ejb-relationship-role>

<ejb-relationship-role-name>Competition-has-a-Event</ejb-relationship-role-n
ame>
    <key-fields/>
      </ejb-relationship-role>
      <ejb-relationship-role>

<ejb-relationship-role-name>Event-has-many-Competitions</ejb-relationship-ro
le-name>
          <fk-constraint>true</fk-constraint>
          <key-fields>
             <key-field>
               <field-name>id</field-name>
               <column-name>event_fk</column-name>
             </key-field>
          </key-fields>
      </ejb-relationship-role>
    </ejb-relation>
    <ejb-relation>

The XDoclet 1.1.2 output works correctly in that JBoss (built from CVS a few
days ago) creates the foreign key against the database table. Also, if I use
the XDoclet CVS output and move the <fk-constraint>true</fk-constraint> from
the Event-has-many-Competitions relationship role to the
Competitions-has-a-Event relationship, JBoss also creates the foreign key
correctly. But it doesn't work with the untouched output from XDoclet CVS.

I've tried many different tags (including jboss:target-relation) and read as
many posts as I could find on this subject, but to no avail. Any suggestions
would be greatly appreciated.

Thanks

Ben



-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts
on Hammer Technology! Open Source & Linux Developers, register now
for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to