JPA Self Join using JoinTable
问题 I have 1 entity call Item in which I want to be able to link parent items to children. to use a join table to create a parent/child relationship. I haven't been able to get any good documentation on. So if anyone has any thoughts I'm all ears. Here is what I have... which works most of the time. public class Item implements java.io.Serializable { @Id private Long id; @ManyToOne(optional = true, fetch = FetchType.LAZY) @JoinTable(name = "ITEMTOITEM", joinColumns = { @JoinColumn(name = "ITEMID"