spring-attic / grails-data-mapping

Grails Data Mapping Project
Apache License 2.0
151 stars 95 forks source link

NullPointerException is thrown when cascade deleting a broken -to-many relationship #145

Closed noamt closed 11 years ago

noamt commented 11 years ago

Given a *-to-many relationship - There are cases in which a relationship may be broken; that is, a referenced entity is removed, but the reference to it is maintained in the owner.

In such a case, GORM maintains the *-to-many domain instance field as a persistent collection with "null" objects replacing the missing referenced entities.

Some places, such as the cascading collection delete procedure, aren't able to handle a null object.