Bug 383508 - joinfetch inheritance problem
Summary: joinfetch inheritance problem
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard: submitted_patch
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-26 02:13 EDT by Tom CLA
Modified: 2022-06-09 10:29 EDT (History)
3 users (show)

See Also:


Attachments
maven sample project with testcase and patched 2.3.2 InheritancePolicy.java (24.14 KB, application/x-zip-compressed)
2012-06-26 02:13 EDT, Tom CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom CLA 2012-06-26 02:13:02 EDT
Created attachment 217852 [details]
maven sample project with testcase and patched 2.3.2 InheritancePolicy.java

problem:

ProductAAA extends AbstractProduct with InheritanceType.JOINED

em.find(AbstractProduct.class, id);
em.find(ProductAAA.class, id);

do not return the same result for a given ID when AbstractProduct has more than one many-to-one, one-to-one, or a combination of those relationships of the same type, configured to be join-fetched. 


cause:
the query (ReadObjectQuery) passed into InheritancePolicy.selectOneRowUsingDefaultMultipleTableSubclassRead is used for determining the concreteclass, and later for processing the AbstractRow. But since the actual result is fetched using an other query object, the original one does't hold the correct joinedAttributeManager.


possible solution 1:
set concrete referenceClass & descriptor on original query instead of cloning.

possible solution 2:
use the joinedAttributeManager of concreteQuery and set it on the original query.



note:
1. I did't investigate selectOneRowUsingCustomMultipleTableSubclassRead as I'm not sure of the use cases, but I suppose a similar problem exists.

2. selectAllRowUsingDefaultMultipleTableSubclassRead already has a mechanism for handling joinedMappingIndexes.
Comment 1 Tom Ware CLA 2012-07-23 09:52:38 EDT
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.

Note: We try to look at all submitted patches prior to the next patch release.  Hopefully we can look at this patch in that timeframe.
Comment 2 Tom Ware CLA 2012-09-14 15:16:00 EDT
Taking a look
Comment 3 Tom Ware CLA 2013-02-04 11:08:57 EST
Releasing
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:29:56 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink