Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Composite Foreign Primary Key

 
Sybyll Jones
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I'm trying the Hibernate mapping for the table "tabtest":
The table has the composite primary key which consists of time_id and data_id, which are both foreign keys (time_id to tabtime and data_id to tabdata).
Now, i don`t know how the *.hbm.xml-file has to look like...
I use Hibernate2, JRE/JDK 1.6 and no Annotiations by far.

Thanks
Sybyll
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just out of curiosity, can you bump up to Hibernate 3.x?

Mark
 
Sybyll Jones
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, but i heard, that i don`t have to create a special composite mapping in the hbm-files, etc. for the case that the composite key should only be a control-entity (no duplicate values in database).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic