Hello, how do we use cascade when update delete when using entityManager.merge. I have this ff configuration:
MainClass{
@Composition
@OnDelete(DeletePolicy.CASCADE)
@OneToMany(mappedBy = "order", cascade = CascadeType.MERGE)
protected List<SubClass> subClasses;
}
I have tried CascadeType.ALL and PERSIST but it is still not inserting any record on SubClass table. Also, what we need is that if there is a record in the database that is not in the subClassese list, it will be deleted or detached.
Thank you