spring-orm-4.2.6与hibernate-orm-5.2.0不兼容
最新的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?
再见
回答:
Spring Framework 4.3.0将包括对Hibernate
5.2的支持。参见https://jira.spring.io/browse/SPR-14327
以上是 spring-orm-4.2.6与hibernate-orm-5.2.0不兼容 的全部内容, 来源链接: utcz.com/qa/400631.html