• 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

Forigen key to Composit primary Key

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

How can i create hbm mapping for a scenario of Forigen key to Composit primary Key. below is the problem defination.
I have 2 tables one table has 3 columns, all 3 columns are part of composit key. Another table has 2 columns and all the 2 columns are part of composit key.

ITEM_TABLE
USER_ID, DEPARTMENT, ITEM_TYPE

USER_ID, DEPARTMENT, ITEM_TYPE are composit keys.

USER_TABLE
USER_ID, DEPARTMENT

USER_ID, DEPARTMENT are composit keys.

How to create relation between ITEM_TABLE and USER_TABLE.
I am using Hibernate 3.1

Thanks
Purshi
 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This might be helpful but its implemented in JPA
http://www.makemyinfo.com/Tutorial.do?action=getTutorial&tutId=T0009.jsp
Rashid
 
If you try to please everybody, your progress is limited by the noisiest fool. And this 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