Maven and Gradle Hibernate Enhance Plugin

Introduction In this article, I’m going to explain how the configure the Maven and Gradle Hibernate Enhance Plugin. The goal of the Hibernate Enhance plugin is to instrument the JPA entity bytecode in order to improve the effectiveness and efficiency of the associated data access operations.

Hibernate LazyToOne annotation

Introduction In this article, I’m going to explain how the Hibernate LazyToOne annotation works and why you should use NO_PROXY lazy loading with bytecode enhancement. Without the LazyToOneOption.NO_PROXY annotation, the parent-side of a @OneToOne association is always going to be fetched eagerly even if you set it to FetchType.LAZY and enabled bytecode enhancement lazy loading.