saplingPro saplingPro - 15 days ago 5
Java Question

What is cascading in Hibernate?

What is cascading in Hibernate ? There is a

cascade
attribute I have seen in the
map
tag. What is it meant for?

Like what does
cascade = all
mean? There are other attributes I read like

cascade="none|save-update|delete|all-delete-orphan|delete-orphan"
.

Answer

Cascading is about deletion of one object from the database causing deletion of other (dependent) objects .... though of course it is typically database rows that are actually getting deleted.

Cascading can also apply to saves / updates as well.

Comments