I'm looking for information on the cascade types that exist and how they work in relational modeling with JPA. The types I found explanations were:
- NONE = Do not do anything with the object (default)
- MERGE = Update children when updating parent only if already persistent
- PERSIST = Save child when saving parent
- REFRESH = Saves parent and keeps child unchanged
- REMOVE = Removes child when removing parent and vice versa
-
ALL = Performs all cascade operations
I have the following doubts:
Is the working explanation of these types of cascade
correct?
Mapping with mappedBy
should put cascade
on parent object only?