Skip to content

Instantly share code, notes, and snippets.

View WearyMonkey's full-sized avatar

Toby Rahilly WearyMonkey

View GitHub Profile
@rponte
rponte / Parent.java
Last active April 7, 2021 04:46
Handling Hibernate (JPA) lazy association mapping when using @NotFound
@Entity
public class Parent {
@Id
private Long id;
@OneToOne(fetch = FetchType.LAZY)
@NotFound(action=NotFoundAction.IGNORE) // You don't need this annotation if you use the approach below
private Son son;