Skip to content

Instantly share code, notes, and snippets.

@mohamed-gara
Created July 13, 2018 06:04
Show Gist options
  • Save mohamed-gara/02505b45da9fb1ee1eca04068603170d to your computer and use it in GitHub Desktop.
Save mohamed-gara/02505b45da9fb1ee1eca04068603170d to your computer and use it in GitHub Desktop.
Person with parents relationship
@Entity
@Data
public class Person extends core.Person {
@ManyToOne(fetch = LAZY)
@NotFound(action = NotFoundAction.IGNORE)
private Person mother;
@ManyToOne(fetch = LAZY)
@NotFound(action = NotFoundAction.EXCEPTION)
private Person father;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment