What is cascading in Hibernate?

Cascading in Hibernate propagates an operation performed on a parent entity to its associated child entities automatically. Instead of manually saving, updating, or deleting each related object, you configure a cascade rule once on the association and Hibernate applies it whenever the parent changes.

Key Points

Example

If an Order entity has a @OneToMany(cascade = CascadeType.ALL) collection of OrderItem, calling session.save(order) automatically saves all the OrderItem objects in that collection without an explicit save() call for each one.

@Entity
public class Order {
    @OneToMany(mappedBy = "order", cascade = CascadeType.ALL, orphanRemoval = true)
    private List<OrderItem> items = new ArrayList<>();
}

Interview Tip

A concise interview answer is

Cascading lets an operation on a parent entity automatically propagate to its associated children, configured through CascadeType values like PERSIST, MERGE, or REMOVE on the association mapping — so saving or deleting an Order can automatically save or delete its OrderItems without extra code.

Last updated: 16 July 2026

Previous question: Explain the role of the @Entity annotation in Hibernate.

Next question: What is a composite key in Hibernate?

More Hibernate (Optional) interview questions

All Hibernate (Optional) questions