Hi,
short question: There seems to be a difference between the CascadeRype.ALL and the List of all singe CascadeTypes ({CascadeType.DETACH ,CascadeType.REFRESH ,CascadeType.REMOVE ,CascadeType.MERGE ,CascadeType.PERSIST }). Example: I have 2 Entities, A and B. A has a one to many relation to b, mapped by: @OneToMany(cascade = { CascadeType.ALL }, mappedBy = "b") If I call now save on my A Entity, A and the related B Entities are persisted. If I replace the Annotation with @OneToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH }, mappedBy = "b") the b Entities are not persistet, if I call save on A. So there must be i difference between ALL and the list of alle singe Cascading Types, although the documentation says, that this is the same. Has someone an explanation for this?
Greetings and thanks for your help, Andreas
|