Home > AI > Backend > SpringBoot > mysql-connector-java >

Cascading

Cascading is the way to achieve this. When we perform some action on the target entity, the same action will be applied to the associated entity.

2.1. JPA Cascade Type

All JPA-specific cascade operations are represented by the javax.persistence.CascadeType enum containing entries:

  • ALL
  • PERSIST
  • MERGE
  • REMOVE
  • REFRESH
  • DETACH

2.2. Hibernate Cascade Type

Hibernate supports three additional Cascade Types along with those specified by JPA. These Hibernate-specific Cascade Types are available in org.hibernate.annotations.CascadeType:

  • REPLICATE
  • SAVE_UPDATE
  • LOCK

Leave a Reply