Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330755 - Nested embeddables can't be used as embedded ids
Summary: Nested embeddables can't be used as embedded ids
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Guy Pelletier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-21 13:46 EST by Sabine Heider CLA
Modified: 2022-06-09 10:04 EDT (History)
4 users (show)

See Also:


Attachments
Proposed changes (22.16 KB, patch)
2010-12-15 14:01 EST, Guy Pelletier CLA
no flags Details | Diff
Updated patch (34.26 KB, patch)
2010-12-17 13:50 EST, Guy Pelletier CLA
no flags Details | Diff
activate model classes with nested embeddables in WDF test suite (5.35 KB, patch)
2011-01-17 12:32 EST, Adrian Goerler CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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