O'Reilly logo

Spring Persistence with Hibernate by Ahmad Seddighi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Cascading operations

A cascading operation indicates how changes to the persistent object affect associated objects when an object is persisted. For instance, if the removed object is associated with other objects, what should happen to the others when the removed object is erased from the database?

I'll explain with an example. Consider the Teacher class in the educational system application. Suppose that each teacher is associated with a single course, meaning the Teacher class has a property of type Course. If we use the TEACHER and COURSE tables, respectively, to store the Teacher and Course objects in the database, then corresponding to each Teacher object is a single Course object, and corresponding to each row in the TEACHER table is a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required