Community
Participate
Working Groups
Given the following example, I generated DDL and no exception was given. I am trying to figure out what the default referenced column name for a join column is in this case, or in the case where one of the referenced column names is specified. @Entity @IdClass(EntityAIdClass.class) public class EntityA { @Id private int id; @Id private int id2; @ElementCollection @CollectionTable(name="EmbeddableType" , joinColumns={ @JoinColumn(name="id"), @JoinColumn(name="owningEntity") } ) @MapKey(name="language") private Map<String, EmbeddableType> embeddableTypes; } public class EntityAIdClass { private int id; private int id2; } @Embeddable public class EmbeddableType { @Column(name="data") private String data; @Column(name="language", nullable=false) private String language; }
When processing the join columns of the element collection we are incorrectly using the embeddable's descriptor to validate the join columns.
Created attachment 170526 [details] Proposed changes Issue here was that for an element collection containing an Embeddable we would incorrectly pass in the embeddable's descriptor to validate the join columns. It's also wrong in the sense that we would also incorrectly default the join columns in a composite primary key case. A new test has been provided.
Changes have been submitted Reviewed by: Tom Ware Tests: Expanded test (testCreateDepartment) from AdvancedCompositePKJunitTest. Also tested the negative test manually on my machine and on Karen's machine.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink