2 Replies Latest reply on Feb 22, 2005 2:50 PM by mr.m

    Compound primary key relationship to foreign keys in EJB 2.1

    mr.m

      I believe a problem I?m experiencing is because of a shortcoming in the EJB 2.1 specification, and I?m wondering if you?re familiar with the problem or any plans to address it in the EJB 3.0 specification? The problem is described in the scenario below.

      Best Regards,
      Mr. M

      =========================
      Scenario

      A legacy table has a 3 column primary key. 2 of the columns relate to the FK of table B, and the 3rd key relates to the FK of table C. I have no control over the database design and must map my CMP EJBs as-is.

      The schema is: http://engel.us/ejbmapping/schema.gif

      Problem
      It doesn't appear that JBoss is flexible enough to support my schema. Is JBoss incapable of mapping this relationship? If JBoss can handle it, how do I define the ejb-jar.xml relationships? When JBoss loads my beans, I get this error:

      EJB
      org.jboss.deployment.DeploymentException: Mappings were not provided for all fie
      lds: unmaped fields=[classIndex] in role=x_CLASS_SYM-cmp20-has-x_MASTER_SYMB
      OL-cmp20


      http://engel.us/ejbmapping/stack_dump.txt

      My table relationships are defined as:

      http://engel.us/ejbmapping/ejb-jar.xml
      http://engel.us/ejbmapping/jbosscmp-jdbc.xml