The problem is that you have the userId in both the EmbeddedId as in the relationship to the User Entity. If I remember it well you can use the @MapsId annotation to indicate that the userId is mapped to the User Entity:
posted 5 years ago
thanks for you help.
it did fix the problem!
posted 4 years ago
daphna deutsch wrote:Hello,
I have the following objects:
And UserReasonPK object:
I want to be able to add userReason to the list, and that Hibernate will automatically update the reference between the parent & child object.
When using the above code, when trying to start the server, i'm getting the error message:
Please notice that i mapped the userId in UserReasonPK with insertable = false, updatable = false.
If i change it, and add this on the User property in UserReason object, server is up, but when trying to insert new User i'm getting the following error:
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad: