Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » Gemini JPA principle questions
Gemini JPA principle questions [message #1739100] Wed, 27 July 2016 14:11 Go to next message
Pavel No is currently offline Pavel NoFriend
Messages: 47
Registered: May 2016
Member
Hello everyone.

I have two questions about jemini jpa:

1) How does it work? I mean just a line of sequences. For example, I see it this way:
mybunlde->jemini osgi service->eclipselink osgi service->h2 osgi service. Is this correct? If not then how?

2) If I have one persistence.xml in all my bundls then there is no question. I do this way:
reference = bundleContext.getServiceReference(EntityManagerFactory.class.getName());
EntityManagerFactory emf = (EntityManagerFactory) bundleContext.getService(reference);
EntityManager entityManager=emf.createEntityManager();

By other words I get factory and using that factory I get manager.

However, if I have N persistenceunits then what? As I understand I should get EntityManagerFactoryBuilder as osgi service and using it create factory? Something like
ServiceReference reference = bundleContext.getServiceReference(EntityManagerFactoryBuilder.class.getName());
        EntityManagerFactoryBuilder emfb = (EntityManagerFactoryBuilder) bundleContext.getService(reference);
EntityManagerFactory emf=emfb.createEntityManagerFactory(map).

However, I can't understand how to add my entity classes to this map? Or should I link it with persistence.xml?

Please, help.

[Updated on: Wed, 27 July 2016 14:13]

Report message to a moderator

Re: Gemini JPA principle questions [message #1739252 is a reply to message #1739100] Fri, 29 July 2016 02:28 Go to previous messageGo to next message
Michael Keith is currently offline Michael KeithFriend
Messages: 243
Registered: July 2009
Senior Member
Have a look at:

https://wiki.eclipse.org/Gemini/JPA/Documentation/JPAServices

You can look up EMFs for any of the persistence units that are defined in the persistence xml file. If you need to use the properties with the builder then you can get the EMF for a given persistence unit as shown in the example in that doc.

-Mike
Re: Gemini JPA principle questions [message #1739253 is a reply to message #1739252] Fri, 29 July 2016 03:17 Go to previous messageGo to next message
Pavel No is currently offline Pavel NoFriend
Messages: 47
Registered: May 2016
Member
Thank you very much. This is what I was looking for. Can you answer to the first question? I need to know exactly what does gemini jpa, what does eclipselink. As I understand factorybuilder and factory services are provided by gemini jpa. Please, help.
Re: Gemini JPA principle questions [message #1739543 is a reply to message #1739253] Tue, 02 August 2016 19:05 Go to previous message
Michael Keith is currently offline Michael KeithFriend
Messages: 243
Registered: July 2009
Senior Member
Everything having to do with OSGi is Gemini JPA, while everything that is stock JPA is done by EclipseLink. Gemini JPA is basically just an OSGi wrapper implementation around EclipseLink.
Previous Topic:Wildfly 10 + JBoss OSGi + Spring + Gemini Blueprint startup is slow and fills memory
Next Topic:Gemini Web has shipped 3.0.0 RELEASE
Goto Forum:
  


Current Time: Thu Apr 18 12:13:59 GMT 2024

Powered by FUDForum. Page generated in 0.02150 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top