【问题标题】:Spring JPA + Hibernate(3.5,3.6, 4.0 .....) IntegrationSpring JPA + Hibernate(3.5,3.6, 4.0 .....) 集成
【发布时间】:2011-07-22 13:04:54
【问题描述】:

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 集成的替代建议?

【问题讨论】:

    标签: java hibernate spring orm jpa


    【解决方案1】:

    您可以在春季 JIRA 中提出相关问题。我怀疑文档没有更新。适配器非常非常简单(检查source code),没有什么可以出错的。我们在生产环境中将它与 hibernate 3.5 一起使用,没有任何问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-10
      • 2012-08-22
      • 1970-01-01
      • 2017-10-23
      • 1970-01-01
      • 2018-04-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多