adspace
What is cascading and what are different types of cascading?
Answer Posted / Satish Kumar Ranjan
Cascading in Hibernate refers to the propagation of certain operations, such as save, update, delete, or refresh, from one entity instance to related entities. There are five different types of cascading in Hibernate:
1. Cascade.ALL: Cascades all lifecycle operations (save, update, delete, and refresh) from the parent entity to the child entities.
2. Cascade.PERSIST: Cascades only the save operation from the parent entity to the child entities.
3. Cascade.MERGE: Cascades only the merge operation from the parent entity to the child entities.
4. Cascade.REMOVE: Cascades only the delete operation from the parent entity to the child entities.
5. Cascade.REFRESH: Cascades only the refresh operation from the parent entity to the child entities.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers