Hi,
You are mixing two enums with similar names:
- javax.persistence.CascadeType
- org.hibernate.annotations.CascadeType
The @OneToMany annotation expects only the first one, so your @OneToMany should read:
Code:
@OneToMany(cascade = CascadeType.ALL)
To also specify DELET_ORPHAN, I do the following but I'm not sure whether its necessary:
Code:
@Cascade({ org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
The @Cascade annotation is from the package org.hibernate.annotations.
Regards,
Ronald Wildenberg