I use Hibernate for a project, and I'm confused about when to use org.hibernate.annotations.CascadeType and when to use javax.persistence.CascadeType annotations.
For example, when I should use something like this:
@OneToMany(fetch = FetchType.LAZY, cascade = javax.persistence.CascadeType.ALL)
vs something like this:
@OneToMany(fetch = FetchType.LAZY) @Cascade(org.hibernate.annotations.CascadeType.ALL)
I also read that sleep mode will ignore some types of cascades that are in the annotations of xxxx. Maybe someone just planted me right?
java hibernate jpa
Jimmy johnson
source share