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

Bug 337425

Summary: loading JPA embeddable classes stored in other bundles
Product: [RT] Gemini Reporter: Jan Bols <guterfluss>
Component: Gemini DemosAssignee: Michael Keith <michael.keith>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: cvgaviao, grischan_engel, guterfluss, laeubi, mariuszcwikla, sergei.jochim, thomas.gillet.2
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Jan Bols CLA 2011-02-17 07:42:22 EST
According to the OSGI JPA Specs, it's not required to support persistence units distributed across multiple bundles. This means all your domain classes need to be located in the same bundle.

IMHO this is not realistic. 

F.i. I have some Money class used as a value type. It's stored in a separate "model.core" bundle because it's used in several persistence bundles (like "model.accounting" and "model.reporting") that import the Money class. 

In the current OSGi JPA spec this would not be allowed because the Money class is not defined in the persistence bundle itself. So I would need a separate Money class for each persistence bundle. (Money1.class in the persistence bundle "model.accounting" and Money2.class in the persistence bundle "model.reporting).

I don't see any enterprise level OSGi project using JPA being developed with this limitation. 

It would be nice if gemini jpa would allow spreading the model across several bundles and using the OSGi class loading mechanism to access them.
Comment 1 Sergei Jochim CLA 2011-07-12 03:04:24 EDT
I have a similar use-case. I'm writing an extension for a server bundle and want to create new entities in the extension bundle, which will be added on start.
Comment 2 Grischan Engel CLA 2012-08-19 05:26:57 EDT
Are there any news about that issue?
Comment 3 Thomas Gillet CLA 2012-08-20 05:47:57 EDT
If using entities from fragment bundles works for you, there is bug #335698 about that, and until it is resolved there is a workaround here: http://www.eclipse.org/forums/index.php/mv/msg/365382/895890/#msg_895890
Comment 4 Christoph Laeubrich CLA 2013-02-26 10:53:41 EST
I would also vote for this :-)
Fragments does not help in any way, then you do not have to copy them to the bundle but to the fragment...
Comment 5 Mariusz Cwikla CLA 2014-07-01 15:15:00 EDT
I have the same problem.

Voted.