The cascade types supported by the Java Persistence Architecture are as below:
CascadeType.PERSIST : means that save() or persist() operations cascade to related entities.
CascadeType.MERGE : means that related entities are merged into managed state when the owning entity is merged.
CascadeType.REFRESH : does the same thing for the refresh() operation.
CascadeType.REMOVE : removes all related entities association with this setting when the owning entity is deleted.
CascadeType.DETACH : detaches all related entities if a “manual detach” occurs.
CascadeType.ALL : is shorthand for all of the above cascade operations.
The cascade configuration option accepts an array of CascadeTypes; thus, to include only refreshes and merges in the cascade operation for a One-to-Many relationship in the following example, you might see the following: