Forums Register Login

Hibernate compsite key timestamp

+Pie Number of slices to send: Send
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?
I claim this furniture in the name of The Ottoman Empire! You can keep this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1094 times.
Similar Threads
[Hibernate] Composite key one-to-many XML Error
Foreig key must have same number of columns as the referenced primary key
ids for this class must be manually assigned before calling save()
Set- Key Mapping issue with nested-composite-element
Map an object that has composite id containing a mapping to object that itself has composite id?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 23:02:56.