Wagby issues SQL via Hibernate. This section explains how to check SQL using Hibernate's settings.
By adding the following line to log4j.properties, the SQL executed in system.log is output.
I will explain how to check HQL generated by Hibernate directly by changing hibernate.cfg.xml of the built application.
<hibernate-configuration> <session-factory> ... <property name="show_sql">true</property> ... </session-factory> </hibernate-configuration>
The output SQL has the following form.This is precisely the HQL handled by Hibernate.
select jgroupid_0_."userid" as userid1_61_0_, jgroupid_0_."jgroupid" as jgroupid2_56_0_, jgroupid_0_."jgroupidjshid" as jgroupid3_0_ from "juser$jgroupid" jgroupid_0_ where jgroupid_0_."userid"=?
The condition part of the where clause is '?'.The actual value is not displayed.