小编典典

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

hibernate

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

引起原因:java.lang.NoSuchMethodError:org.hibernate.Session.getFlushMode()Lorg /
hibernate / FlushMode;
在org.springframework.orm.jpa.vendor.HibernateJpaDialect.prepareFlushMode(HibernateJpaDialect.java:187)在org.springframework.orm.jpa.vendor.HibernateJpaDialect.prepareTransaction(HibernateJpaDialect.java:182)在org.spring.framework.org
org.springframework.orm.jpa.EntityManagerFactoryUtils.doGetTransactionalEntityManager(EntityManagerFactoryUtils.java:293)上的.EntityManagerFactoryUtils.prepareTransaction(EntityManagerFactoryUtils.java:321)

Spring何时提供与Hibernate 5.2.0兼容的HibernateJpaDialect?

再见


阅读 377

收藏
2020-06-20

共1个答案

小编典典

Spring Framework 4.3.0将包括对Hibernate
5.2的支持。参见https://jira.spring.io/browse/SPR-14327

2020-06-20