0 Replies Latest reply on Jul 17, 2003 9:23 AM by sreneg

    one to one relation between PKs

    sreneg

      Hi all,

      I have a small problem with relation between Primary Keys in EJB's but I don't know if I do some errors or if there are some restrictions in JBoss.

      I have two EJB's entity "A" and "B".
      A has one pk called "aId" and some other fields.
      B has two pks, bId1 and bId2 and other fields.

      I have to place on B two one-to-one relation to A: the first between the pk-field of B: bId1 and the pk-field of A: aId and the second between B: bId2 and A: aId.

      I produced the necessary files (java + xml + jar) but when I deploy the jar in JBoss I obtained the following Exception:

      15:00:13,679 ERROR [EntityContainer] Starting failed
      org.jboss.deployment.DeploymentException: Mappings were not provided for all fie
      lds: unmaped fields=[bId2] in role=bRelationshipRole
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.
      loadKeyFields(JDBCRelationshipRoleMetaData.java:408)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.
      init(JDBCRelationshipRoleMetaData.java:161)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMetaData.(J
      DBCRelationMetaData.java:341)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.(JDBCApplicationMetaData.java:404)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXm
      lFileLoader.java:75)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaDat
      a(JDBCStoreManager.java:737)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBC
      StoreManager.java:430)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManage
      r.java:372)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManag
      er.java:170)
      at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:340)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
      92)
      at sun.reflect.GeneratedMethodAccessor137.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)

      <.... and more ....>

      I'm using JBoss-3.2.2RC1_tomcat-4.1.24 and MySQL for deploying and JBuilder or Eclipse+Lomboz like IDE.

      Thanks.