Hi
I've an unidirectionnal ManyToMany relationship like that :
Hi, I am having trouble deleting an entity in a unidirectional manytomany relationship:
Code:
@Entity
class Flag{
@Id
Long id;
}
@Entity
class Mail{
@Id
String id;
@ManyToMany
Set<Flag> flags;
}
I can have a large number of Mail wich use one Flag so i would like to be able to delete a Flag without to select & edit each Mail wich use it.
The only solution i've found to do that consist to execute native SQL queries on my DB. However entity manager cache & 2nd level cache will not be refreshed.
Have you any suggestions ?
Thanks for your help
PHaroZ