spring-orm-4.2.6与hibernate-orm-5.2.0不兼容

时间:2016-06-03 09:35:03

标签: hibernate jpa spring-orm

最新的Hibernate ORM版本(5.2.0)使Spring ORM(4.2.6,最新版本)不兼容,因为Hibernate必须将其Session.getFlushMode重命名为Session.getHibernateFlushMode,导致此NoSuchMethodError:

  

引起:java.lang.NoSuchMethodError:   org.hibernate.Session.getFlushMode()Lorg /休眠/ FlushMode;在   org.springframework.orm.jpa.vendor.HibernateJpaDialect.prepareFlushMode(HibernateJpaDialect.java:187)     在   org.springframework.orm.jpa.vendor.HibernateJpaDialect.prepareTransaction(HibernateJpaDialect.java:182)     在   org.springframework.orm.jpa.EntityManagerFactoryUtils.prepareTransaction(EntityManagerFactoryUtils.java:321)     在   org.springframework.orm.jpa.EntityManagerFactoryUtils.doGetTransactionalEntityManager(EntityManagerFactoryUtils.java:293)

Spring什么时候会提供与Hibernate 5.2.0兼容的HibernateJpaDialect?

再见

1 个答案:

答案 0 :(得分:4)

Spring Framework 4.3.0将包含对Hibernate 5.2的支持。见https://jersey.java.net/documentation/latest/ioc.html