相关疑难解决方法(0)

无法使hibernate停止使用Spring JPA Vendor Adapter显示SQL

Hibernate继续向stdout发送SQL跟踪,当隐藏在JPA适配器后面时,我无法弄清楚如何更改Hibernate配置属性.这是entityManagerFactory的Spring bean:

<bean id="entityManagerFactory" 
    class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="dataSource" ref="ssapDataSource"/>
    <property name="jpaVendorAdapter">
        <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" >
            <property name="showSql" value="false"/>
        </bean>
    </property>
</bean>
Run Code Online (Sandbox Code Playgroud)

即使将showSql属性设置为false,Hibernate也会继续打印SQL.

我已经尝试使用"hibernate.show_sql = false"在我的类路径中创建一个hibernate.properties文件,但它也没有选择它.

spring hibernate jpa

15
推荐指数
2
解决办法
2万
查看次数

标签 统计

hibernate ×1

jpa ×1

spring ×1