p6spy 对于调试休眠查询非常有用,但是,有什么方法可以使用与休眠相同的逻辑来格式化查询?:
<property name="hibernate.format_sql" value="true" />
p6spy 日志示例:
p6spy - 1339663561390|15|0|statement|select personne0_.id as id5_,personne0_.dateNaissance as dateNais2_5_, personne0_.nom as nom5_, personne0_.prenom as prenom5_, personne0_.type as type5_ from Personne personne0_ where personne0_.nom=?|select personne0_.id as id5_, personne0_.dateNaissance as dateNais2_5_, personne0_.nom as nom5_, personne0_.prenom as prenom5_, personne0_.type as type5_ from Personne personne0_ where personne0_.nom='example'
休眠日志示例:
Hibernate:
insert
into
TABLE
(COLUMN_1, COLUMN_2)
values
(?, ?)
我认为hibernate格式更具可读性,我想要p6spy这样的东西。
谢谢你。