2 Replies Latest reply on Jul 1, 2002 2:00 AM by seshu kumar

    Problem with 1:1 CMP example from MasteringEJB2

    seshu kumar Newbie

      Hi,

      I'm trying to deply Order-Shipment 1:1 CMP example from EdRomans book.
      as in the book in my ejb-jar.xml I have,
      ......OrderBean
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>OrderBean</abstract-schema-name>
      <cmp-field><field-name>orderID</field-name></cmp-field>
      <cmp-field><field-name>name</field-name></cmp-field>
      <primkey-field>orderID</primkey-field>

      .......ShipmentBean

      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>ShipmentBean</abstract-schema-name>
      <cmp-field><field-name>shipmentID</field-name></cmp-field>
      <cmp-field><field-name>city</field-name></cmp-field>
      <cmp-field><field-name>zipcode</field-name></cmp-field>
      <primkey-field>shipmentID</primkey-field>

      ......Relationship filed
      <cmr-field>
      <cmr-field-name>shipment</cmr-field-name>
      </cmr-field>

      ......

      I have declared two methods in Order entity bean class as
      public abstract getShipment();
      public abstract void setShipment(Shipment s);

      The tables created by JBoss are as follows
      Table: Order
      ------------
      Field 1: ORDERID(PK)
      Field 2: NAME
      Field 3: SHIPMENT

      Table: Shipment
      Field 1: SHIPMENT(PK)
      Field 2: CITY
      Field 3: ZIPCODE
      Field 4: ORDERS_SHIPMENT

      There is no FK constraint created.

      Obviously the foriegn key relationship os missing. Where should i specify this. Please help!