Browsed by
Category: Hibernate

Hibernate logging

Hibernate logging

Working with object-relation mapping (ORM) tools like Hibernate lets developers operate mostly with object-oriented entities rather than relational tables, SQL, etc. Sounds quite attractive, but only from the first look. When the domain becomes more complex, sooner or later you’ll need to investigate the exact SQL queries being executed. So, let’s figure out how to enable various types of Hibernate logging.

N+1 select: JOIN FETCH (Hibernate)

N+1 select: JOIN FETCH (Hibernate)

Using object-relational mapping tools like Hibernate can significantly simplify and speed up the development process. For a developer, it’s easier to operate with object entities rather than switching to relational tables every time he needs to access a database. Nevertheless, it has its disadvantages. The main disadvantage is a high chance to ruin the performance if used without a good understanding of how it works under the hood. This tutorial covers the common problem called “N+1 select” and describes one of the solutions – JOIN FETCH.