In a @OneToMany relationship between two entity types, if the entity on the One side has a composite key, objects on the Many side fail on insert when persisting the entity on the One side. Seems like it can't resolve the embedded ID when when creating the insert statement. The error is something like:
ERROR insert into vehicle(make, model, "id") values ("Toyota", "Corolla", "com.site.entity.OwnerKey")
Here id is not a column name, but the Java field variable in the Owner entity:
@EmbeddedId
private OwnerKey id;
The "id" is not resolving to the column names specified in @JoinColumns, and the OwnerKey object is not resolving to its values.
In a @OneToMany relationship between two entity types, if the entity on the One side has a composite key, objects on the Many side fail on insert when persisting the entity on the One side. Seems like it can't resolve the embedded ID when when creating the insert statement. The error is something like: ERROR insert into vehicle(make, model, "id") values ("Toyota", "Corolla", "com.site.entity.OwnerKey")
Here id is not a column name, but the Java field variable in the Owner entity: @EmbeddedId private OwnerKey id;
The "id" is not resolving to the column names specified in @JoinColumns, and the OwnerKey object is not resolving to its values.