Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315782 - JPA2 derived identity metadata processing validation doesn't account for autoboxing
Summary: JPA2 derived identity metadata processing validation doesn't account for auto...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Guy Pelletier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-04 11:09 EDT by Karen Butzke CLA
Modified: 2022-06-09 10:05 EDT (History)
5 users (show)

See Also:


Attachments
Proposed changes (19.05 KB, patch)
2010-08-04 14:05 EDT, Guy Pelletier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2010-06-04 11:09:41 EDT
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)
Comment 1 Tom Ware CLA 2010-06-14 14:26:44 EDT
Setting target and priority.  See the following page for details of what these fields mean:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Comment 2 Guy Pelletier CLA 2010-08-04 14:05:59 EDT
Created attachment 175859 [details]
Proposed changes
Comment 3 Guy Pelletier CLA 2010-08-04 14:30:47 EDT
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.
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:05:10 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink