Hibernate JPA - delete children within list

0
public class A implements Serializable {

   @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
   @JoinColumn(name = "A_ID")
   private List<B> bList;

}

public class B implements Serializable {
   @JoinColumn(name = "A_ID", referencedColumnName = "ID")
   @ManyToOne(optional = false)
   private A a;
}

At a great cost I was able to get Hibernate to leave the foreign key of table A inside B as null in a register update, but with orphanRemoval = true it should delete those records from table B, which is not happening . How do I solve this problem?

    
asked by anonymous 29.05.2018 / 15:43

0 answers