At first I’ve expected that with CascadeType.REMOVE I’ll be able to delete foreign keys in my table , but I sill got an exception. But with @CascadeOnDelete it’s ok .What’s the difference between the two annotations?
EDIT: I’ve saw the DataNucleus’ comment.Cascade on delete comes from org.eclipse.persistence.annotations.CascadeOnDelete .Which raises the question how good idea is to be used.
When you use CascadeType.Remove at the time the cascading will be handled by the ORM tool but when you want the cascading to be handled by the database you can use @CascadeOnDelete.but when you are using @CascadeOnDelete , make sure the Database you are using should support cascading.