7 Replies Latest reply on Apr 16, 2002 4:57 AM by lairi

    JBOSS 3.0 Foreign key mapping problem

    lairi Newbie

      Hi,

      The pb is :
      With a relation one to many, unable to get the beanlocalobject when using findbyprimarykey on the many side : an exception is thrown java.lang.IllegalArgumentException: object is not an instance of declaring class

      Settings
      there are 2 tables: A and B
      A: primarykey=a_pk
      B: primarykey=(a_pk,b_pk) , foreignkey=a_pk

      in ejb-jar.xml
      <ejb-relationship-role>
      <ejb-relationship-role-name>B-has-A</ejb-relationship-role-name>
      Many
      <relationship-role-source>
      <ejb-name>B</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>a_pk</cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>

      <ejb-relationship-role>
      <ejb-relationship-role-name>A-has-Bs</ejb-relationship-role-name>
      One
      <relationship-role-source>
      <ejb-name>A</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>bs</cmr-field-name>
      <cmr-field-type>java.util.Collection</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>


      in the jbosscmp-jdbc.xml
      <ejb-relation-name>A-B</ejb-relation-name>
      <foreign-key-mapping>
      <ejb-relationship-role>
      <ejb-relationship-role-name>A-has-Bs</ejb-relationship-role-name>
      <fk-constraint>false</fk-constraint>
      <foreign-key-fields/>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>B-has-A</ejb-relationship-role-name>
      <foreign-key-field>
      <field-name>a_pk</field-name>
      <column-name>A_PK</column-name>
      </foreign-key-field>
      </ejb-relationship-role>
      </foreign-key-mapping>

      In the beans :
      A :
      has a getBS() that return a Collection
      a_pk is declared as a cmp field

      B :
      a_pk is declared as a cmp field and (cmr field in ejb_jar)
      getA_pk(), setA_pk(type_of_a_pk)
      b_pk is declared as a cmp field

      Can anyone help me

        • 1. Re: JBOSS 3.0 Foreign key mapping problem
          miriam Newbie

          Try to put the <ejb-relationship-role> tags outside the
          <foreign-key-mapping> tag.
          Maybe it works, I had a pb with the constraint not being declared if the <ejb-relationship-role> tags were enclosed by the <foreign-key-mapping> tag.

          • 2. Re: JBOSS 3.0 Foreign key mapping problem
            Marcus Brito Novice

            The jbosscmp-jdbc.xml DTD has changed in beta2! <foreign-key-mapping/> is now an empty element and you need <key-field/> elements to declare which fields are used as foreign keys.

            Please take a look at the new DTD.

            P.S.: maybe this needs to be mentioned in the FAQ. And the f(r)ee docs needs to be updated!

            • 3. Re: JBOSS 3.0 Foreign key mapping problem
              Dain Sundstrom Master

              This has been fixed. Upgrade to RC1.

              • 4. Re: JBOSS 3.0 Foreign key mapping problem
                lairi Newbie

                Hi,

                Wa are using Xdoclet 1.2.
                Can you, please, provide us the final syntax at JBoss level for the part:
                <ejb-relation>
                ...
                expresing bi-directionnal n-ary relationship in the file jbosscmp-jdbc.xml.

                Another question: do we have to modifiate the file ejb-jar.xml? if yes, what is the modification? and where?

                Thank you

                • 5. Re: JBOSS 3.0 Foreign key mapping problem
                  Marcus Brito Novice

                  Take a look at this post:

                  http://main.jboss.org/thread.jsp?forum=46&thread=12702

                  I explained how to write the relationships section in this post.

                  • 6. Re: JBOSS 3.0 Foreign key mapping problem
                    lairi Newbie

                    Hi,

                    We have a Descriptor bean and a Denomination bean. They have a 1-n relationship.

                    Descriptor: 1
                    Denomination: n

                    Primary key for Descriptor is descriptorId and primary key for Denomination is (denominationId, langauge).

                    The foreign key of Denomination Bean is denominationId which corresponds to descriptorId in Descriptor Bean.

                    The unidirectional relationship is given by using Using Xdoclet 1.2:

                    jbosscmp-jdbc.xml
                    -------------------------

                    <ejb-relation>
                    <ejb-relation-name>descriptor-denomination</ejb-relation-name>
                    <foreign-key-mapping/>
                    <ejb-relationship-role>
                    <ejb-relationship-role-name>descriptor-has-denomination</ejb-relationship-role-name>
                    <fk-constraint>false</fk-constraint>
                    <key-fields/>
                    </ejb-relationship-role>
                    <ejb-relationship-role>
                    <ejb-relationship-role-name>denomination-has-descriptor</ejb-relationship-role-name>
                    <key-fields>
                    <key-field>
                    <field-name>DescriptorId</field-name>
                    <column-name>DenominationId</column-name>
                    </key-field>
                    </key-fields>
                    </ejb-relationship-role>
                    </ejb-relation>



                    ejb-jar.xml
                    --------------
                    <!-- Relationships -->

                    <ejb-relation >
                    <ejb-relation-name>descriptor-denomination</ejb-relation-name>
                    <!-- unidirectional -->
                    <ejb-relationship-role >
                    <ejb-relationship-role-name>descriptor-has-denomination</ejb-relationship-role-name>
                    One
                    <relationship-role-source >
                    <ejb-name>Descriptor</ejb-name>
                    </relationship-role-source>
                    <cmr-field >
                    <cmr-field-name>denominations</cmr-field-name>
                    <cmr-field-type>java.util.Collection</cmr-field-type>
                    </cmr-field>
                    </ejb-relationship-role>
                    <ejb-relationship-role >
                    <ejb-relationship-role-name>denomination-has-descriptor</ejb-relationship-role-name>
                    Many
                    <relationship-role-source >
                    <ejb-name>Denomination</ejb-name>
                    </relationship-role-source>
                    </ejb-relationship-role>
                    </ejb-relation>



                    This error is generated :

                    2002-04-16 10:28:14,584 ERROR [org.jboss.ejb.EntityContainer] Exception in service lifecyle operation: create
                    org.jboss.deployment.DeploymentException: CMP field for key not found: field name=DescriptorId
                    at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.loadKeyFields(JDBCRelationshipRoleMetaData.java:374)
                    at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.init(JDBCRelationshipRoleMetaData.java:157)
                    at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMetaData.(JDBCRelationMetaData.java:308)
                    at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.(JDBCApplicationMetaData.java:383)
                    at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:75)
                    at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCStoreManager.java:595)
                    at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.create(JDBCStoreManager.java:322)
                    at org.jboss.ejb.plugins.CMPPersistenceManager.create(CMPPersistenceManager.java:155)
                    at org.jboss.ejb.EntityContainer.create(EntityContainer.java:337)
                    at org.jboss.ejb.Container.invoke(Container.java:790)
                    at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
                    at $Proxy0.create(Unknown Source)
                    at org.jboss.system.ServiceController.create(ServiceController.java:271)
                    at java.lang.reflect.Method.invoke(Native Method)
                    at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                    at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                    at $Proxy15.create(Unknown Source)
                    at org.jboss.ejb.EjbModule.createService(EjbModule.java:381)
                    at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:134)
                    at java.lang.reflect.Method.invoke(Native Method)
                    at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
                    at $Proxy0.create(Unknown Source)
                    at org.jboss.system.ServiceController.create(ServiceController.java:271)
                    at org.jboss.system.ServiceController.create(ServiceController.java:211)
                    at java.lang.reflect.Method.invoke(Native Method)
                    at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                    at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                    at $Proxy5.create(Unknown Source)
                    at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:376)
                    at org.jboss.deployment.MainDeployer.create(MainDeployer.java:626)
                    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:506)
                    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:470)
                    at java.lang.reflect.Method.invoke(Native Method)
                    at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                    at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                    at $Proxy4.deploy(Unknown Source)
                    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:350)
                    at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:530)
                    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:410)
                    at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:237)
                    at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:162)
                    at java.lang.reflect.Method.invoke(Native Method)
                    at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
                    at $Proxy0.start(Unknown Source)
                    at org.jboss.system.ServiceController.start(ServiceController.java:341)
                    at java.lang.reflect.Method.invoke(Native Method)
                    at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                    at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                    at $Proxy3.start(Unknown Source)
                    at org.jboss.deployment.SARDeployer.start(SARDeployer.java:281)
                    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:665)
                    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:507)
                    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:470)
                    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:452)
                    at java.lang.reflect.Method.invoke(Native Method)
                    at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                    at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:320)
                    at org.jboss.system.server.ServerImpl.start(ServerImpl.java:218)
                    at org.jboss.Main.boot(Main.java:142)
                    at org.jboss.Main$1.run(Main.java:375)
                    at java.lang.Thread.run(Thread.java:484)
                    2002-04-16 10:28:15,195 DEBUG [org.jboss.system.ServiceController] destroying service: jboss.j2ee:service=EJB,jndiName=Descriptor
                    2002-04-16 10:28:15,195 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] Cancelling 0 passivation jobs
                    2002-04-16 10:28:15,195 ERROR [org.jboss.ejb.EntityContainer] Exception in service lifecyle operation: destroy
                    java.lang.NullPointerException


                    We have the same problem by using the solution proposed in

                    http://main.jboss.org/thread.jsp?forum=46&thread=12702


                    <ejb-relation>
                    <ejb-relation-name>descriptor-denomination</ejb-relation-name>
                    <foreign-key-mapping/>
                    <ejb-relationship-role>
                    <ejb-relationship-role-name>descriptor-has-denomination</ejb-relationship-role-name>
                    <fk-constraint>false</fk-constraint>
                    <key-fields>
                    <key-field>
                    <field-name>DescriptorId</field-name>
                    <column-name>DenominationId</column-name>
                    </key-field>
                    </key-fields>
                    </ejb-relationship-role>
                    <ejb-relationship-role>
                    <ejb-relationship-role-name>denomination-has-descriptor</ejb-relationship-role-name>
                    <key-fields/>
                    </ejb-relationship-role>
                    </ejb-relation>


                    Please how to resolve this problem.

                    Thanks.


                    • 7. Re: JBOSS 3.0 Foreign key mapping problem
                      lairi Newbie

                      Hi,

                      We have a Descriptor bean and a Denomination bean. They have a 1-n relationship.

                      Descriptor: 1
                      Denomination: n

                      Primary key for Descriptor is descriptorId and primary key for Denomination is (denominationId, langauge).

                      The foreign key of Denomination Bean is denominationId which corresponds to descriptorId in Descriptor Bean.

                      The unidirectional relationship is given by using Using Xdoclet 1.2:

                      jbosscmp-jdbc.xml
                      -------------------------

                      <ejb-relation>
                      <ejb-relation-name>descriptor-denomination</ejb-relation-name>
                      <foreign-key-mapping/>
                      <ejb-relationship-role>
                      <ejb-relationship-role-name>descriptor-has-denomination</ejb-relationship-role-name>
                      <fk-constraint>false</fk-constraint>
                      <key-fields/>
                      </ejb-relationship-role>
                      <ejb-relationship-role>
                      <ejb-relationship-role-name>denomination-has-descriptor</ejb-relationship-role-name>
                      <key-fields>
                      <key-field>
                      <field-name>DescriptorId</field-name>
                      <column-name>DenominationId</column-name>
                      </key-field>
                      </key-fields>
                      </ejb-relationship-role>
                      </ejb-relation>



                      ejb-jar.xml
                      --------------
                      <!-- Relationships -->

                      <ejb-relation >
                      <ejb-relation-name>descriptor-denomination</ejb-relation-name>
                      <!-- unidirectional -->
                      <ejb-relationship-role >
                      <ejb-relationship-role-name>descriptor-has-denomination</ejb-relationship-role-name>
                      One
                      <relationship-role-source >
                      <ejb-name>Descriptor</ejb-name>
                      </relationship-role-source>
                      <cmr-field >
                      <cmr-field-name>denominations</cmr-field-name>
                      <cmr-field-type>java.util.Collection</cmr-field-type>
                      </cmr-field>
                      </ejb-relationship-role>
                      <ejb-relationship-role >
                      <ejb-relationship-role-name>denomination-has-descriptor</ejb-relationship-role-name>
                      Many
                      <relationship-role-source >
                      <ejb-name>Denomination</ejb-name>
                      </relationship-role-source>
                      </ejb-relationship-role>
                      </ejb-relation>



                      This error is generated :

                      2002-04-16 10:28:14,584 ERROR [org.jboss.ejb.EntityContainer] Exception in service lifecyle operation: create
                      org.jboss.deployment.DeploymentException: CMP field for key not found: field name=DescriptorId
                      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.loadKeyFields(JDBCRelationshipRoleMetaData.java:374)
                      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.init(JDBCRelationshipRoleMetaData.java:157)
                      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMetaData.(JDBCRelationMetaData.java:308)
                      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.(JDBCApplicationMetaData.java:383)
                      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:75)
                      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCStoreManager.java:595)
                      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.create(JDBCStoreManager.java:322)
                      at org.jboss.ejb.plugins.CMPPersistenceManager.create(CMPPersistenceManager.java:155)
                      at org.jboss.ejb.EntityContainer.create(EntityContainer.java:337)
                      at org.jboss.ejb.Container.invoke(Container.java:790)
                      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
                      at $Proxy0.create(Unknown Source)
                      at org.jboss.system.ServiceController.create(ServiceController.java:271)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                      at $Proxy15.create(Unknown Source)
                      at org.jboss.ejb.EjbModule.createService(EjbModule.java:381)
                      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:134)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
                      at $Proxy0.create(Unknown Source)
                      at org.jboss.system.ServiceController.create(ServiceController.java:271)
                      at org.jboss.system.ServiceController.create(ServiceController.java:211)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                      at $Proxy5.create(Unknown Source)
                      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:376)
                      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:626)
                      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:506)
                      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:470)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                      at $Proxy4.deploy(Unknown Source)
                      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:350)
                      at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:530)
                      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:410)
                      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:237)
                      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:162)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
                      at $Proxy0.start(Unknown Source)
                      at org.jboss.system.ServiceController.start(ServiceController.java:341)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                      at $Proxy3.start(Unknown Source)
                      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:281)
                      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:665)
                      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:507)
                      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:470)
                      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:452)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:320)
                      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:218)
                      at org.jboss.Main.boot(Main.java:142)
                      at org.jboss.Main$1.run(Main.java:375)
                      at java.lang.Thread.run(Thread.java:484)
                      2002-04-16 10:28:15,195 DEBUG [org.jboss.system.ServiceController] destroying service: jboss.j2ee:service=EJB,jndiName=Descriptor
                      2002-04-16 10:28:15,195 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] Cancelling 0 passivation jobs
                      2002-04-16 10:28:15,195 ERROR [org.jboss.ejb.EntityContainer] Exception in service lifecyle operation: destroy
                      java.lang.NullPointerException


                      We have the same problem by using the solution proposed in

                      http://main.jboss.org/thread.jsp?forum=46&thread=12702


                      <ejb-relation>
                      <ejb-relation-name>descriptor-denomination</ejb-relation-name>
                      <foreign-key-mapping/>
                      <ejb-relationship-role>
                      <ejb-relationship-role-name>descriptor-has-denomination</ejb-relationship-role-name>
                      <fk-constraint>false</fk-constraint>
                      <key-fields>
                      <key-field>
                      <field-name>DescriptorId</field-name>
                      <column-name>DenominationId</column-name>
                      </key-field>
                      </key-fields>
                      </ejb-relationship-role>
                      <ejb-relationship-role>
                      <ejb-relationship-role-name>denomination-has-descriptor</ejb-relationship-role-name>
                      <key-fields/>
                      </ejb-relationship-role>
                      </ejb-relation>


                      Please how to resolve this problem.

                      Thanks.