0

I'm trying to migration my project to Hibernante 6 but I face some problems...

  1. "type" attribute of @Type annotation is not recognized : @Type(type = "yes_no")

  2. Problem to instanciate entityManagerFactory :

     LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
     entityManagerFactoryBean.setPersistenceProviderClass(**HibernatePersistenceProvider.class**);
    

HibernatePersistenceProvider implements jakarta.persistence.spi.PersistenceProvider instead of javax.persistence.spi.PersistenceProvider

Have you any idea please ?

Thanks

Mohamed
  • 2,342
  • 4
  • 21
  • 32
  • Does this answer your question? [Using Hibernate 6.x with Spring Boot 2.7.x not working?](https://stackoverflow.com/questions/73257636/using-hibernate-6-x-with-spring-boot-2-7-x-not-working) – Didier L Dec 20 '22 at 15:25

2 Answers2

1

For Hibernate 6 you'll need a 3.x release of Spring Data JPA. The latest Spring Data JPA release is 3.0.0 M4

Even with that Hibernate 6 support is flaky since Hibernate broke a lot of stuff both internally and for users as Spring Data JPA.

I'd recommend waiting until 3.0.0 GA.

Jens Schauder
  • 77,657
  • 34
  • 181
  • 348
0

For issue #1, as stated in the Hibernate 6.0 migration guide here,

Hibernate < 6.0:

@Type(type="yes_no")
boolean isActive;

Hibernate >= 6.0:

@Convert(converter=YesNoConverter.class)
boolean isActive;
franky duke
  • 269
  • 2
  • 8