Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » Gemini Jpa: Howto specify a jpa vendor adapter?
Gemini Jpa: Howto specify a jpa vendor adapter? [message #1052844] Tue, 30 April 2013 12:53 Go to next message
Peter Kullmann is currently offline Peter Kullmann
Messages: 199
Registered: July 2009
Senior Member
I would like to migrate to gemini jpa for one of our applications.

I'm tracking the EntityManagerFactoryBuilder Service and call createEntityManager with some properties:
- javax.persistence.jdbc.url
- javax.persistence.jdbc.driver
- javax.persistence.jdbc.user
- javax.persistence.jdbc.password

This is working well.

When I was creating the EMF myself (before gemini jpa) I was specifying a jpaVendorAdapter like that:

	<bean id="entityManagerFactory"
		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<property name="jpaVendorAdapter" ref="eclipseLinkJpaVendorAdapter" />
		<property name="jpaPropertyMap">
			<map>
				<entry key="eclipselink.weaving" value="true" />
				<entry key="eclipselink.ddl-generation" value="${eclipselink.ddl-generation}" />
			</map>
		</property>
		<property name="loadTimeWeaver">
			<ref bean="domain-weaver" />
		</property>
	</bean>


Is it possible to specify a jpaVendorAdapter as a property to EMFBuilder.createEntityManager? Do I need one?


Thanks,
Peter
Re: Gemini Jpa: Howto specify a jpa vendor adapter? [message #1052966 is a reply to message #1052844] Wed, 01 May 2013 11:44 Go to previous messageGo to next message
Mike Keith is currently offline Mike Keith
Messages: 211
Registered: July 2009
Senior Member
Hi Peter,

Once you move to Gemini JPA then you are in the world of dynamic OSGi services. This means that a vanilla Spring component could find itself without a dependency because the service is not yet registered and ready. You might instead want to use Blueprint or similar OSGi component model to allow the service to be injected.

-Mike
Re: Gemini Jpa: Howto specify a jpa vendor adapter? [message #1053028 is a reply to message #1052966] Thu, 02 May 2013 02:33 Go to previous messageGo to next message
Peter Kullmann is currently offline Peter Kullmann
Messages: 199
Registered: July 2009
Senior Member
Hi Mike,
I'm already using blueprint. Can you elaborate about a jpa vendor adapter? Do I have to create one and publish it as an OSGi service? Do I have to specify properties so that it will be wired to the EMF?

Regards,
Peter
Re: Gemini Jpa: Howto specify a jpa vendor adapter? [message #1053176 is a reply to message #1053028] Thu, 02 May 2013 16:43 Go to previous message
Mike Keith is currently offline Mike Keith
Messages: 211
Registered: July 2009
Senior Member
Hi Peter,

No, you should not need the vendor adapter or any of the traditional Spring properties. You just inject the EMF service that Gemini JPA makes available.

-Mike
Previous Topic:Gemini JPA messes around with OSGI startup sequence
Next Topic:Gemini Naming 1.0.2.RELEASE is now available
Goto Forum:
  


Current Time: Mon Jul 28 12:34:02 EDT 2014

Powered by FUDForum. Page generated in 0.04760 seconds