Hi,
In the Hibernate Annotations Reference Guide (
https://www.hibernate.org/5.html), it is "recommended to use @Cascade to compliment @*To*(cascade=...)" as in the following example:
Code:
@OneToMany( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )
@Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE,
org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
public Collection<Employer> getEmployers()
The Reference Guide fails to mention
why it is better to use @Cascade with @*To*(cascade=...). Can anyone explain that to me?
Thanks in Advance!