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

Bug 355157

Summary: eGet returns null when using EAV schema after session.merge
Product: [Modeling] EMF Reporter: Kevin Page <pagekb>
Component: TeneoAssignee: Martin Taal <mtaal>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: d.nikita.e
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
XSD used to reproduce
none
Java snippet asserting that value should not be null none

Description Kevin Page CLA 2011-08-18 15:29:06 EDT
Build Identifier: 1.2.0.v201107080556

Hi Martin!

I have a few tests that run against a standard schema and an EAV version of that same schema (i.e., with the property PersistenceOptions.EAV_MAPPING set to true).  We are testing the round-trip of a value using this code:

session.beginTransaction();
EObject valueFromDb = (EObject) session.merge(value);
session.getTransaction().commit();

When used with a traditional schema, valueFromDb.eGet(eStructuralFeature) returns the correct value.  Using EAV, eGet returns null.  Expected: eGet should return the correct value under both schema types.

Thanks!

Kevin


Reproducible: Always

Steps to Reproduce:
1. Call session.merge on a valid EObject
2. Call eGet on a valid EStructuralFeature of the merged EObject
3. Observe that the return value of eGet is null.
Comment 1 Kevin Page CLA 2011-08-18 15:35:20 EDT
Created attachment 201745 [details]
XSD used to reproduce
Comment 2 Kevin Page CLA 2011-08-18 15:45:54 EDT
Created attachment 201746 [details]
Java snippet asserting that value should not be null
Comment 3 Martin Taal CLA 2011-09-01 16:03:06 EDT
Hi Kevin,
So you are aware of the progress. I can reproduce this in a testcase. I need to change the logic for the Merge operation for EAV types. It will take some time (few days/week or so). I will keep you posted in this bugzilla.

gr. Martin
Comment 4 Martin Taal CLA 2011-11-25 10:03:00 EST
Hmm, I can't find a good solution, this was also remarked during the implementation of this feature. You can try the HbUtil.merge method to do merging.

See the remark here:
http://wiki.eclipse.org/Teneo/Hibernate/ModelRelational/Entity_Attribute_Value_Mapping#Limitations

Can you re-open the issue if HbUtil.merge does not work for you?

gr. Martin