Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330075 - [Hibernate] TeneoHibernateMappingProvider#getMapping() does not remove EcorePackage/EResourcePackage
Summary: [Hibernate] TeneoHibernateMappingProvider#getMapping() does not remove EcoreP...
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 3.0   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Taal CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-12 06:36 EST by Karsten Thoms CLA
Modified: 2019-11-08 03:15 EST (History)
1 user (show)

See Also:
mtaal: review? (stepper)


Attachments
Patch for this issue (1.62 KB, patch)
2010-11-12 23:23 EST, Martin Taal CLA
no flags Details | Diff
Patch v2 (2.14 KB, patch)
2010-11-13 01:46 EST, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karsten Thoms CLA 2010-11-12 06:36:48 EST
In method TeneoHibernateMappingProvider#getMapping() the packages EcorePackage and EResourcePackage are intended to be be removed:

----------------------------------------------------------------------------------
    // translate the list of EPackages to an array
    final List<EPackage> epacks = getHibernateStore().getPackageHandler().getEPackages();
    // remove the ecore and resource package
    epacks.remove(EcorePackage.eINSTANCE);
    epacks.remove(EresourcePackage.eINSTANCE);
----------------------------------------------------------------------------------
 
This does not work (or at least in the scenario I had) this way, since the HibernateStore's package handler retrieves another instance then the singleton instance the plugins provide.

Instead of trying to remove the packages by instance from the packs list they have to be removed by their nsURI. The instances in epacks that match EcorePackage.eNS_URI and EResourcePackage.eNS_URI must be searched and removed.
Comment 1 Martin Taal CLA 2010-11-12 23:23:32 EST
Created attachment 183066 [details]
Patch for this issue
Comment 2 Eike Stepper CLA 2010-11-13 01:46:32 EST
Created attachment 183067 [details]
Patch v2

Using CDOModelUtil.isSystemPackage now...
Comment 3 Eike Stepper CLA 2010-11-13 01:47:26 EST
Committed to R3_0_maintenance
Comment 4 Eike Stepper CLA 2011-06-23 04:27:22 EDT
Moving all open problem reports to 4.0
Comment 5 Eike Stepper CLA 2012-09-21 06:36:55 EDT
Undoing accidental version change.
Comment 6 Eike Stepper CLA 2012-09-21 06:50:50 EDT
Closing.