marhatta
marhatta

Reputation:

What is the difference between REMOVE and DELETE?

Is there a difference between :

Upvotes: 24

Views: 15544

Answers (1)

ChssPly76
ChssPly76

Reputation: 100686

There is no difference; they're synonyms.

Documentation is rather silent on this but if you look at AnnotationBinder.getCascadeStrategy() source, both are being translated to Hibernate's "delete" cascade type.

The reason that both exist (and I'm guessing here) is because Hibernate core has always used "DELETE" as cascade type, but JPA's CascadeType specifies "REMOVE" as a constant. Hibernate Annotations' CascadeType, being part of Hibernate's JPA extension thus has both for completeness / consistency.

Upvotes: 28

Related Questions