I am executing the following HQL and it is executing properly
String hql = "FROM Employee";
Query query = session.createQuery(hql);
List results = query.list();
Now i also want to log the sql generated at the backend in logs for support users , I want to make use of QueryTranslator please advise how can I generate the sql for corresponding HQL please advise how to achieve this.
I found next solution on the web:
Source: http://narcanti.keyboardsamurais.de/hibernate-hql-to-sql-translation.html
you can get the Query out by using the unwrap method.
I believe you want a combination of the top 2 answers
You can use hibernate QueryTranslator: