Entity A and B have a many to many relationship using link table AtoB.
If Entity A is deleted, the related links are deleted by hibernate. So far so good.
My problem is that my link table is a view hiding a much more complicated relationship and works perfectly in this situation except when hiberate tries to delete the link rows from the view, causing the database to complain.
@Entity A...
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "AtoB",
joinColumns = @JoinColumn(name = "A_ID"),
inverseJoinColumns = @JoinColumn(name = "B_ID"))
public Set<A> getASet() {
return ASet;
}
Is there a way to get hibernate to not delete the link rows? I haven't found any cascade options or the ability to use updateable=false etc on an association.
Cheers.