@Target(value={METHOD,FIELD,TYPE})
@Retention(value=RUNTIME)
public @interface CascadeOnDelete
The constraint cascaded depends on the mapping, only relationship mappings are allowed. The relationship should also use cascade remove, or deleteOrphans.
For a OneToOne it can only be defined if the mapping uses a mappedBy, and will delete the target object.
It cannot be defined for a ManyToOne.
For a OneToMany it will delete the target objects, or ONLY the join table if using a join table.
For a ManyToMany it will delete the rows from the join table, not the target objects.
For an ElementCollection it will delete the target rows.
For an Entity it will delete the secondary or JOINED inheritance tables.