Community
Participate
Working Groups
Found this while verifying Dali bug 308271, EclipseLink has the same issue. @Entity public class Parent { @Id Long id; } public class ChildPK implements Serializable { private long parent; } @Entity @IdClass(ChildPK.class) public class Child { @Id @ManyToOne private Parent parent; } Exception Description: The composite primary key attribute [parent] of type [null] on entity class [class model.Child] should be of the same type as defined on its primary key class [model.ChildPK]. That is, it should be of type [long]. at org.eclipse.persistence.exceptions.ValidationException.invalidCompositePKAttribute(ValidationException.java:1143) at org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor.validatePKClassId(MetadataDescriptor.java:1756)
Setting target and priority. See the following page for details of what these fields mean: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Created attachment 175859 [details] Proposed changes
Changes have been submitted. Reviewed by: Tom Ware Model change to expose the validation exception. With fix in place, exception does not occur and existing JPA FullRegressionTest and extended test suite passed successfully.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink