• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Composite foreign key mapping in Hibernate 3 using JPA

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

We have a table
A(a_id, name) where a_id is primary key
B(b_id, name) where b_id is primary key
C(a_id, b_id) where a_id & b_id are composite key and foreign key to table 'A' & 'B'

We have proper mapping for table 'A' & 'B' in hibernate 3 using annotation.

But we are not sure how to create entity class for table 'C', since it does not have any primary key.
We wanted to know how to map composite foreign key.

Can any one please help us how to create the entity class for table 'C'
 
aman thind
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. We made some small changes since our composite primary key was a combination of foreign keys but it worked:)
Thanks once again.
 
What I don't understand is how they changed the earth's orbit to fit the metric calendar. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic