The best way to log SQL statements with JPA and Hibernate

Опубликовано: 09 Октябрь 2024
на канале: Vlad Mihalcea
12,889
114

If you're using JPA and Hibernate, then you should definitely know what SQL statements your JPA provider executes behind the scenes.

While the internal logging framework Hibernate offers is good for basic usage, in reality, you need a much more powerful JDBC statement proxy mechanism, which, apart from logging, it can even help you to assert the number of statements being executed.