2

Most amount of information found was in the official docs.

I want to replace the JPA provider completely (use Hibernate OGM)

One solution would be to create a bean for transactions and a bean with emf.

EntityManagerFactory emf = Persistence.createEntityManagerFactory( "id_from_persistence.xml");

But what I am really looking for is to completely integrate another JPA provider into SpringBoot, how possible is that?

@Bean
public LocalEntityManagerFactoryBean entityManagerFactory(){
    LocalEntityManagerFactoryBean factoryBean = new LocalEntityManagerFactoryBean();
    factoryBean.setPersistenceUnitName("id_from_persistence.xml");
    return factoryBean;
}

If it is - i am definitely missing something out, first exception is Entity Manager is not initialized.

As far as I have understood Id need to provide my own implementation of org.springframework.orm.jpa.JpaVendorAdapter? As an example there exists the following class:

 org.hibernate.ogm.jpa.impl.OgmEntityManagerFactory implements HibernateEntityManagerFactory 
  1. What auto configuration classes to disable?
  2. What manual configuration is further required?

Leading on I got the following class suggested for controlling the persistence in Spring:

org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
Bato-Bair Tsyrenov
  • 1,174
  • 3
  • 17
  • 40

0 Answers0