Hibernate is continuing to spew SQL traces to stdout, and I can't figure out how to change a Hibernate configuration property when it's hidden behind a JPA adapter. This is the Spring bean for the entityManagerFactory:
<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>
Even with the showSql property set to false, Hibernate keeps printing SQL.
I've tried making a hibernate.properties file in my classpath with "hibernate.show_sql=false", but it didn't pick that up either.
Try setting it in persistance.xml
<persistence>
<persistence-unit name="PU">
<properties>
<property name="hibernate.show_sql" value="false"/>
</properties>
</persistence-unit>
</persistence>
<property name="jpaProperties">
<props>
<prop key="hibernate.show_sql">false</prop>
</props>
</property>
this will also work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With