Impetus / kundera

A JPA 2.1 compliant Polyglot Object-Datastore Mapping Library for NoSQL Datastores.Please subscribe to:
http://groups.google.com/group/kundera-discuss/subscribe
Apache License 2.0
903 stars 233 forks source link

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

Open thoaisoldier opened 6 years ago

thoaisoldier commented 6 years ago

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.