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. Before Hibernate 5.5, 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. Since Hibernate 5.5, you no longer need to use LazyToOneOption.NO_PROXY with bytecode enhancement.