• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate compsite key timestamp  RSS feed

Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • 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?
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!