Hi,
I have a pretty simple setup of two classes.
class A { @NaturalId String key
@NaturalId String key2 }
class B extends A { @NaturalId String key3 }
From such a structure I expect there to be a Unique constraint on { key, key2, key3 } such that if any of the 3 keys are different then the whole group (the NaturalId) is considered unique. This is what I have been doing with hibernate and single classes for a while now.
Yet when I attempt to insert a new B with a unique key2 I get an error that I'm violating the uniqueness of key3. Do @NaturalId's not combine across inherited classes? If not does anyone have a suggestion for what I could replace these keys with? Perhaps some sort of unique constraint defined within B...
|