I just wasted time trying various permutations of this code to attempt to reproduce the reported error. This was impossible. The given test code suffers the following:
- it’s completely wrong to use @NaturalId instead of @EmbeddedId and Hibernate reports this problem immediately
- the test code depends on Springs non-JPA-standard default naming strategy (grrrr)
- @MappedSuperclass is meaningless on an @Embeddable
After fixing those problems the code ran perfectly. (It’s quite clear the reporter of this issue never even tried to run the provided code, and did not understand the correct usage of the annotations that occur in it.) Please close this issue. |