你必須TRACE
級別的日誌記錄設置到這個休眠包和參數綁定應該在你的應用程序日誌顯示:
<category name="org.hibernate.type">
<priority value="TRACE"/>
</category>
輸出例如:
13:58:51,505 DEBUG [SQL]
insert
into
s.audit
(action, e_s, ip, time, userid, id)
values
(?, ?, ?, ?, ?, ?)
13:58:51,505 TRACE [StringType] binding 'Modify user' to parameter: 1
13:58:51,505 TRACE [StringType] binding 'E' to parameter: 2
13:58:51,505 TRACE [StringType] binding '164.20.81.65' to parameter: 3
13:58:51,505 TRACE [TimestampType] binding '2012-07-30 13:58:51' to parameter: 4
13:58:51,505 TRACE [IntegerType] binding '158' to parameter: 5
13:58:51,505 TRACE [IntegerType] binding '8851' to parameter: 6
而且不要忘記'hibernate.show_sql=true'
你之前說過的屬性也會顯示相關的SQL。
你檢查了任何答案嗎? – jelies 2012-09-25 17:34:39