3 Replies Latest reply on Jul 16, 2003 11:42 AM by windyboy

    Problem with xdoclet generate n-m relation

    windyboy Newbie

      the problems is:

      org.jboss.deployment.DeploymentException: CMP field for key not
      ound: field name=parkingGroup, ObjectName: jboss.j2ee:jndiName=ejb/ams/rmmf/Pak
      ngGroup,service=EJB
      state: FAILED

      but I got the field parkingGroup in the entity Parking
      Group....



      i use jbuilder opentool to generate the JAR, it can deploy on the jboss.
      but the jar I generated by xdoclet can not deploy?

      here some source:
      AircraftTypeBean.java
      /**
      * @ejb.relation
      * name = "ParkingGroup-AircraftType"
      * role-name = "aircrafttype-has-parkinggroup"
      *
      * @jboss.relation-table
      * table-name = "stndtype_acrftype"
      *
      * @jboss.relation
      * fk-column = "aircraft_type_code"
      * related-pk-field = "aircraftTypeCode"
      *
      * @ejb.interface-method
      */

      PakingGroupBean.java
      /**
      * @ejb.relation
      * name = "ParkingGroup-AircraftType"
      * role-name = "parkinggroup-has-aircrafttype"
      *
      * @jboss.relation-table
      * table-name = "stndtype_acrftype"
      *
      * @jboss.relation
      * related-pk-field = "parkingGroup"
      * fk-column = "parking_group"
      *
      * @ejb.interface-method
      *
      */


      ejb-jar.xml
      <ejb-relation >
      <ejb-relation-name>ParkingGroup-AircraftType</ejb-relation-name>

      <ejb-relationship-role >
      <ejb-relationship-role-name>aircrafttype-has-parkinggroup</ejb-relationship-role-name>
      Many
      <relationship-role-source >
      <ejb-name>AircraftType</ejb-name>
      </relationship-role-source>
      <cmr-field >
      <cmr-field-name>parkingGroup</cmr-field-name>
      <cmr-field-type>java.util.Collection</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>

      <ejb-relationship-role >
      <ejb-relationship-role-name>parkinggroup-has-aircrafttype</ejb-relationship-role-name>
      Many
      <relationship-role-source >
      <ejb-name>PakingGroup</ejb-name>
      </relationship-role-source>
      <cmr-field >
      <cmr-field-name>aircraftType</cmr-field-name>
      <cmr-field-type>java.util.Collection</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>

      </ejb-relation>

      jbosscmp-jdbc.xml
      <ejb-relation>
      <ejb-relation-name>ParkingGroup-AircraftType</ejb-relation-name>
      <relation-table-mapping>
      <table-name>stndtype_acrftype</table-name>
      </relation-table-mapping>

      <ejb-relationship-role>
      <ejb-relationship-role-name>aircrafttype-has-parkinggroup</ejb-relationship-role-name>
      <key-fields>
      <key-field>
      <field-name>parkingGroup</field-name>
      <column-name>parking_group</column-name>
      </key-field>
      </key-fields>

      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>parkinggroup-has-aircrafttype</ejb-relationship-role-name>
      <key-fields>
      <key-field>
      <field-name>aircraftTypeCode</field-name>
      <column-name>aircraft_type_code</column-name>
      </key-field>
      </key-fields>

      </ejb-relationship-role>
      </ejb-relation>