This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 248293 - JPA 2.0 Element Collections
Summary: JPA 2.0 Element Collections
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 248291
  Show dependency tree
 
Reported: 2008-09-23 11:35 EDT by Gordon Yorke CLA
Modified: 2022-06-09 10:27 EDT (History)
6 users (show)

See Also:


Attachments
Core patch (137.14 KB, patch)
2008-11-18 17:15 EST, Andrei Ilitchev CLA
no flags Details | Diff
Slightly updated Core patch (142.59 KB, patch)
2008-11-19 16:59 EST, Andrei Ilitchev CLA
no flags Details | Diff
Code changes - part 1 (291.82 KB, patch)
2009-01-28 10:45 EST, Guy Pelletier CLA
no flags Details | Diff
Code changes - part 2 (343.44 KB, patch)
2009-02-06 14:17 EST, 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 Gordon Yorke CLA 2008-09-23 11:35:49 EDT
 
Comment 1 Gordon Yorke CLA 2008-09-23 11:44:34 EDT
This bug targets supporting the new ElementCollections in the JPA 2.0 specification.

See http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/new_collection_mappings for details

Comment 2 Andrei Ilitchev CLA 2008-11-18 17:15:29 EST
Created attachment 118199 [details]
Core patch

This patch contains the necessary changes in core so that jpa 2.0 element collections could be supported:
1. Allow several AggregateCollectionMapping to have the same target class - the target AggregateCollectionDescriptor is now cloned (as it was always the case for AggregateObjectMapping descriptor).
1.1 Defined addFieldNameTranslation method in AggregateCollectonMapping that allows to map the field defined in the target AggregateMappingDescriptor to the actual field. Note that it supports inheritance - use this method to translate the fields of the target class subclasses as well.
1.2 Defined addNestedFieldNameTranslation method in AggregateCollectonMapping that allows to map the field defined in the nested target AggregateMappingDescriptor to the actual field (this method also supports inheritance).

2. Allows AggregateDescriptor to be used as a target of AggregateCollectionMapping: the cloned AggregateDescriptor type is changed to AggregateCollectionDescriptor, all fields (other than class indicator) are primary key fields.

The patch contains several tests, the new exceptions not yet defined.
Note that the new AggregateCollectionMethods are not currently compatible with project.xml.
Comment 3 Andrei Ilitchev CLA 2008-11-19 16:59:05 EST
Created attachment 118321 [details]
Slightly updated Core patch

Patch updated following James's comments.
Comment 4 Guy Pelletier CLA 2009-01-28 10:45:25 EST
Created attachment 124036 [details]
Code changes - part 1

These are the code changes, part 1 to support the ElementCollection annotation, namely support for
element collections of basics and embeddables.

Things to come:
- MapKeyClass/MapKeyJoinColumn support
- Join-table support with association override
- Support of dot notation on overriders for nested embedded attributes
- key. and value. support with overriders
- More exceptions and log messages
- OrderColumn support
- Converter support for element collection map key value
Comment 5 Guy Pelletier CLA 2009-01-29 08:24:57 EST
Part 1 patch has been submitted.

Reviewed by: Tom Ware

Existing model and tests from the inherited (annotation) model were expanded to test the new element collection and then those same tests and model changes were copied over to the xml inherited model and tests to verify the xml configurations.

Test suites: 
 - org.eclipse.persistence.testing.tests.jpa.inheritedInheritedModelJunitTest
 - org.eclipse.persistence.testing.tests.jpa.xml.inherited.EntityMappingsInheritedJUnitTestCase
Comment 6 Karen Butzke CLA 2009-02-06 11:19:43 EST
Is this bug off the table now for 1.1?
Comment 7 Karen Butzke CLA 2009-02-06 11:59:42 EST
Thanks Peter, since the annotation and xml are all Dali is concerned with, we will take this off the table for our EclipseLink 1.1 support.
Comment 8 Guy Pelletier CLA 2009-02-06 14:17:20 EST
Created attachment 124985 [details]
Code changes - part 2

Patch includes:

- dot notation support on attribute overrides for embedded and element collection (both directly and through descriptor level specifications applied to mappings from a mapped superclass)
- new test model changes to verify
- numerous code cleanup/improvements

Dot notation should also work for association overrides since they go through more or less the same code path. No new tests/model changes this round but will be provided in the next patch with more element-collection features.
Comment 9 Guy Pelletier CLA 2009-02-18 15:06:36 EST
This bug is being closed down for the 1.1 release. The continuation of this bug (namely the metadata processing part) is through bug 265359. 

Any metadata processing patches that have been added here were not included in the 1.1 stream and will be available from the main stream.
Comment 10 Eclipse Webmaster CLA 2022-06-09 10:27:18 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink