Is there any way to represent a recursive relationship with annotations in an entity bean ??
I have tried this:
@ManyToOne
@JoinColumn(name="PARENT_ID", referencedColumnName="ITEM.ITEM_ID")
public Item getItem() {
return item;
}
@OneToMany(mappedBy="item")
public Collection getItemCollection() {
return itemCollection;
}
But when i try to access the getItemCollection result it crashes
The thing is, that the Item entity must have this recursive relationship to provide a hierarchical tree of records
Thanks a lot
Showing us the exception might help.
referencedColumnName doesn't look right or that it is needed.