Gemini JPA - Dynamic Entities [message #1234645] |
Wed, 22 January 2014 08:16  |
Eclipse User |
|
|
|
Hi Folks.
I'm using Gemini JPA with Eclipse Virgo, and for now, everything is working nice. I have a domain bundle, that only holds my entities. I have a default persistence.xml file, with basic properties.
The JDBC DataSource is not managed by the domain bundle, because i'm using the EntityManagerFactoryBuilder Service:
<osgi:reference id="entityManagerFactoryBuilder" interface="org.osgi.service.jpa.EntityManagerFactoryBuilder"
filter="(osgi.unit.name=MyPUName)" cardinality="1..1" />
It works nice. But, as my application is very modular, some modules may carry their own entities, and I dont want to deploy a new Persistence Unit, becase I want to integrate the entities. It will be great if exists a way to "register" the new entities, or if we can deploy "domain extension entities" as fragments to the domain bundle. I don't need to unregister the entity later, only register new ones.
Appreciate any help!
Thanks
|
|
|
|
|
Re: Gemini JPA - Dynamic Entities [message #1238071 is a reply to message #1237263] |
Fri, 31 January 2014 05:17  |
Eclipse User |
|
|
|
Hi folks!
Thanks by your answers!
Thomas, I will read the docs that you mention. Maybe we can build a entity registration service, to handle this. 
Sebastian. You pass a good starting point too. I know that all the entities are resolved directly on the domain bundle. Because that, I think that maybe fragments can be used to extend the domain bundle, as it must be avaliable at the same time as the domain bundle (not as an OSGi rule, but you can force this in your structure) and the classpath will be merged, so, a classpath scan can access the new classes without the classloader issues (i think) .
The approach that you mention (merge all classes into a single bundle before deploy) is a way, but it will be a chalenge, because the idea is offer a plugin API that can have a build life cicle outside the main application. I can try to get some hook on the deploy, and scan bundles with a special metatag, and merge it. I will check with with Virgo guys! Maybe they can help me .
Again, thanks by your help!!
|
|
|
Powered by
FUDForum. Page generated in 0.03706 seconds