• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

one-to-one relationship

 
Jolie Lee
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a one-to-one relationship and one of the table has composite key (packageId & softwareID).
This primary key for the other table is softwareID, i declare <cmr-field-name> as softwareId and when i deploy, there's an error

org.jboss.deployment.DeploymentException: Mappings were not provided for all fields: unmaped fields=[packageId] in role=packageitems-has-software


this is my relationship in ejb_jar.xml..


<relationships>
<ejb-relation>
<ejb-relation-name>SoftwarePackage-PackageItems</ejb-relation-name>

<ejb-relationship-role>
<ejb-relationship-role-name>package-has-packageitems</ejb-relationship-role-name>

<multiplicity>One</multiplicity>

<relationship-role-source>
<ejb-name>SoftwarePackageEJB</ejb-name>
</relationship-role-source>

<cmr-field>
<cmr-field-name>softwareID</cmr-field-name>
</cmr-field>
</ejb-relationship-role>

<ejb-relationship-role>
<ejb-relationship-role-name>packageitems-belongs-to-package</ejb-relationship-role-name>

<multiplicity>Many</multiplicity>
<cascade-delete/>

<relationship-role-source>
<ejb-name>SoftwarePackageItemsEJB</ejb-name>
</relationship-role-source>

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


and this is my relationship in jbosscmp_jdbc.xml:

<ejb-relation>
<ejb-relation-name>PackageItems-Software</ejb-relation-name>
<foreign-key-mapping/>

<ejb-relationship-role>
<ejb-relationship-role-name>packageitems-has-software</ejb-relationship-role-name>
<key-fields>
<key-field>
<field-name>softwareId</field-name>
<column-name>SOFTWAREID</column-name>
</key-field>
</key-fields>
</ejb-relationship-role>

<ejb-relationship-role>
<ejb-relationship-role-name>software-belongs-to-packageitems</ejb-relationship-role-name>
<key-fields/>
</ejb-relationship-role>
</ejb-relation>
</relationships>


pls advise.
[ July 18, 2005: Message edited by: Jolie Lee ]
 
Jolie Lee
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any advise pls?
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic