How to convert HQL to SQL Query programmatically (without logging)

后端 未结 7 1369
刺人心
刺人心 2021-02-05 12:10

I am executing the following HQL and it is executing properly

String hql = \"FROM Employee\";
Query query = session.createQuery(hql);
List results = query.list(         


        
7条回答
  •  眼角桃花
    2021-02-05 12:51

    you can get the Query out by using the unwrap method.

    String queryString = query.unwrap(org.hibernate.Query.class).getQueryString();
    

提交回复
热议问题