Може да искате да имате две колони в таблицата за релации,
@ManyToOne(fetch = FetchType.EAGER, cascade=CascadeType.ALL)
@JoinTable(name="Relationship", joinColumns = @JoinTable(name = "Relationship", joinColumns = @JoinColumn(name = "parent_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "id", referencedColumnName = "id"))@Fetch(FetchMode.SELECT)
private Node parentNode;
@OneToMany(fetch=FetchType.EAGER, cascade=CascadeType.ALL)
@JoinTable(name = "Relationship", joinColumns = @JoinColumn(name = "id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "parent_id", referencedColumnName = "id"))
@Fetch(FetchMode.SELECT)
private Set<Node> childNodes;