Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 330755

Summary: Nested embeddables can't be used as embedded ids
Product: z_Archived Reporter: Sabine Heider <sabine.heider>
Component: EclipselinkAssignee: Guy Pelletier <guy.pelletier>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: adrian.goerler, eclipselink.orm-inbox, guy.pelletier, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
Proposed changes
none
Updated patch
none
activate model classes with nested embeddables in WDF test suite none

Description Sabine Heider CLA 2010-11-21 13:46:17 EST
Nested embeddables can't be used as embedded ids. When trying to do so, a validation exception [EclipseLink-7298] is thrown. 

I tried the following mapping, which at least to my understanding of JPA 2 should be valid:

@Entity
public class Project {
    @EmbeddedId private ProjectId id;
    private String description;
    //...
}

@Embeddable
public class ProjectId {
    @Embedded private DeptId dept;
    private String name;
    //...
}

@Embeddable
public class DeptId {
    private int number;
    private String country;
    //...
}
Comment 1 Tom Ware CLA 2010-12-09 09:00:41 EST
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Comment 2 Guy Pelletier CLA 2010-12-15 14:01:49 EST
Created attachment 185254 [details]
Proposed changes
Comment 3 Guy Pelletier CLA 2010-12-17 13:50:10 EST
Created attachment 185452 [details]
Updated patch

Updated after review from Gordon Yorke.
Comment 4 Guy Pelletier CLA 2010-12-17 15:33:33 EST
Changes submitted.

Reviewed by: Gordon Yorke

Tests: New test NestedAggregatePrimaryKeyTest added to FullRegressionTestSuite under JPA Tests/CMP3ComplexAggregateTestModel/
Comment 5 Adrian Goerler CLA 2011-01-17 12:32:39 EST
Created attachment 186928 [details]
activate model classes with nested embeddables in WDF test suite
Comment 6 Adrian Goerler CLA 2011-01-18 15:42:04 EST
WDF tests switched on with rev #8842

Tested on MaxDB, MySQL
Comment 7 Eclipse Webmaster CLA 2022-06-09 10:04:12 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink