First: there is no type="long" - use type="integer".
Now to relations:
To make JPA relations work you have to define relation at JPA level (in your entity declaration):
Code:
// Replace these lines
// @Column (nullable = false)
// private Long parentNodeID;
// with
@ManyToOne
@JoinColumn(name="parentNodeID", referencedColumnName="treeNodeId")
private Tree parentNodeID;
Regards,
Alius
Leave a comment: