• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

one-to-one relationship

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any advise pls?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic