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

Hibernate compsite key timestamp

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm a bit of a Hibernate noob trying to maintain and modify a hibernate app. The situation is that we have a log/audit table that doesn't really need an autogenerated key. It is unique over a composite key. It was asked that we eliminate the unnecessary field.

However, it seems to us that Hibernate really stinks at composite keys. We argued for retaining the autogen key, but it was decided to remove it by powers greater than I. So I tried setting up my file using a composite of two keys.



This results in an exception:



I've tried a few derivations of this approach with similar issues. I think this is what some other developers have also hit and is why they are all trying to convert all our tables to use autogen numerical sequence keys. I keep feeling that Hibernate can't be as popular as it is and not have good support of composite keys...we must just not understand it well.

So can someone both help me with this current issue and maybe point me to a better understanding of whether Hibernate in fact is just not good at composite keys? And if it is good at it, how that works?
 
Hey! Wanna see my flashlight? It looks like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic