I was just reading the Hibernate documentation and came across the warning on this page
http://docs.jboss.org/hibernate/annotations/3.5/reference/en/html_single/#d0e1150
“Warning
The Hibernate team has always felt such a construct as fundamentally wrong. Try hard to fix your data model before using this feature.” with regards to Partial identifier generation
Can someone explain to me in a little more detail what is actually wrong with this? Why does Hibernate look down on generated values? Does that include auto incremented values in Hibernate?
Thanks,
The warning is not about using @GeneratedValue on a class that has only one id field.
The warning is about using @GeneratedValue in one column of a composite key, which is a very odd use case (never seen a need for something like this in 12 years).
So the warning is: If you need to use @GeneratedValue in a composite key, then review your model, because there’s a big chance that there’s something wrong with it.
If you think that this doesn’t answer your question, can you provide an example where you might need this feature?