How to get the JPA generated SQL query?

前端 未结 6 1217
北荒
北荒 2020-12-28 17:50

I use JPA specification and Hibernate as my vendor. I need somehow to take the generated SQL Query which is sent to the the DB (printed to the sysout) and save it as a simpl

6条回答
  •  心在旅途
    2020-12-28 18:21

    You have to enable the log4j logging and add an appender for Hibernate to show the queries.

    This has already been described here: How to print a query string with parameter values when using Hibernate

提交回复
热议问题