Reputation: 9411
I have a complex database request made from some (historical) code using Hibernate towards Oracle 11, as a Named Query expressed in Hibernate Query Language aka HQL. This request is rather slow and I would like to get it fixed. But since Hibernate HQL operates with objects, it is problematic to understand how that is translated to SQL.
What would be the way to see actual SQL queries that are made for a given Named Query, using any feasible way (code/some software etc.)?
Upvotes: 0
Views: 373
Reputation: 419
Please locate file 'hibernate.cfg.xml'. Then, try to locate/add property 'show_sql' and set it as 'true':
<property name="show_sql">true</property>
That should log your queries (without parameters).
Upvotes: 1