• 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: 17309
11
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).
 
We've gotta get close enough to that helmet to pull the choke on it's engine and flood his mind! Or, we could just read this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!