Hibernate is an elegant, straightforward, and easy to use library. This is undeniably true for simple domain models. What about more complex ones? It turns out that in case of complex domain models we usually run into interesting performance issues.
This talk discusses performance anti-patterns on both levels the code of hibernate itself as well as the usage of hibernate in custom applications. First, we present several places in hibernate code that negatively impact performance of object-relational mappings. Then, we explain common mistakes or omissions related to mappings of complex structures. The focus is on efficient retrieval of collections and their sub-objects along with fetching strategies and efficient queries. The presented real code examples illustrate how the anti-patterns can decrease performance and how to implement the mappings to speed up execution times.