Hello,
I've got the code bellow with two many to many associations.
Code:
@ManyToMany(cascade = {CascadeType.ALL} , fetch=FetchType.LAZY)
@JoinTable(name = "T1", joinColumns = @JoinColumn(name = "C1"), inverseJoinColumns = @JoinColumn(name = "C2"))
private List<AuthorizationUnit> authorizationUnits;
@ManyToMany(cascade = {CascadeType.ALL} , fetch = FetchType.LAZY)
@JoinTable(name = "T2", joinColumns = @JoinColumn(name = "C3"), inverseJoinColumns = @JoinColumn(name = "C4"))
private List<Attachment> attachments;
For the first association I would like to cascade delete only the association (in the table T1). It is the current behavior.
For the second association I would like to cascade delete the association and the entity (Attachment).
Thanks for your help,
Pierre-Yves