hibernate sql语句在哪
- 作者: -单手解罩罩
- 来源: 51数据库
- 2020-12-14
如何得到hibernate显示在控制台的hql或sql语句?
找到hibernate的配置文件--
hibernate.cfg.xml
加入:
<property
name="hibernate.show_sql">true</property>
如果你用spring那么就要:
修改spring里面的配置文件:
...
<property
name="hibernateProperties">
<props>
<prop
key
=
"hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop
key
=
"hibernate.show_sql">false</prop>
...
找到hibernate的配置文件--
hibernate.cfg.xml
加入:
<property
name="hibernate.show_sql">true</property>
如果你用spring那么就要:
修改spring里面的配置文件:
...
<property
name="hibernateProperties">
<props>
<prop
key
=
"hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop
key
=
"hibernate.show_sql">false</prop>
...
推荐阅读
