HibernateJpaVendorAdapter用于集成Spring JPA和Hibernate。例如,以下配置有效:
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="trstore" />
<property name="dataSource" ref="dataSource" />
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="databasePlatform" value="${hibernate.dialect}" />
</bean>
</property>
</bean>但据介绍,Spring的文档HibernateJpaVendorAdapter只在Hibernate 3.3上测试过。
http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/orm/jpa/vendor/HibernateJpaVendorAdapter.html
Spring是否计划在更新的Hibernate版本(如3.5、3.6、4.0等)中支持此(HibernateJpaVendorAdapter)?
如果没有,关于如何集成Spring JPA和Hibernate,有什么替代建议吗?
发布于 2011-03-25 07:10:23
您可以在spring JIRA中提出有关该问题的问题。我怀疑文档还没有更新。适配器非常非常简单(检查source code),并且不会出错。我们将它与hibernate 3.5一起使用在生产中,没有任何问题。
https://stackoverflow.com/questions/5426566
复制相似问题