2 Replies Latest reply on Nov 16, 2002 9:37 AM by kiuma

    Setting a cmr object on my bean doesn't work

    kiuma Newbie

      Hi I'm using jboss3.2b + xdoclet cvs

      I've a calendar with many workweek days

      so I configured xdoclet directives for

      WorkweekBean
      /**
      * @ejb.interface-method
      * view-type="local"
      * @ejb.relation
      * name="calendar-workweeks"
      * role-name="workweek-has-calendar"
      * cascade-delete="yes"
      * target-ejb="Calendar"
      * @jboss.relation
      * fk-constraint="true"
      * fk-column="calendar_id"
      * related-pk-field="id"
      */
      public abstract CalendarLocal getCalendar();

      /**
      * @ejb.interface-method
      * view-type="local"
      */
      public abstract void setCalendar(CalendarLocal pCalendarData);



      while for
      CalendarBean

      /**
      * @ejb.relation
      * name="calendar-workweeks"
      * role-name="calendar-has-workweeks"
      * @ejb.interface-method
      * view-type="local"
      */
      public abstract Collection getWorkweeks(); /**
      * @ejb.interface-method
      * view-type="local"
      */
      public abstract void setWorkweeks(Collection pHolydays);


      when in my session I execute the following commands
      WorkweekLocal wEntity = wHome.create( pView ); wEntity.setCalendar( lCalendar );

      Workweek is created, but no calendar_id is set.
      Could you help me please ?



      the piece of the generated jboss_cmp is:
      <ejb-relation>
      <ejb-relation-name>calendar-workweeks</ejb-relation-name>

      <foreign-key-mapping/>

      <ejb-relationship-role>
      <ejb-relationship-role-name>workweek-has-calendar</ejb-relationship-role-name>
      <fk-constraint>true</fk-constraint>
      <key-fields/>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>calendar-has-workweeks</ejb-relationship-role-name>
      <key-fields>
      <key-field>
      <field-name>id</field-name>
      <column-name>calendar_id</column-name>
      </key-field>
      </key-fields>
      </ejb-relationship-role>