Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entities on the many side of a one-to-many relationship fail to insert with composite key #1027

Open
thoaisoldier opened this issue Oct 4, 2018 · 0 comments

Comments

@thoaisoldier
Copy link

thoaisoldier commented Oct 4, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant