Sep 12

Grails PSA – Hibernate Exception w/a _backRef

Let’s say you have two domain objects/models – Feet and Toes.

Obviously, in general a Foot hasMany toes

and obviously (at least we hope) a toe belongsTo a foot.

So given this, if you, say, changed the color of the toenail on a toe, you would expect to then do a toe.save(), right?

WRONG!   You get this crazy _backRef exception and you’re dead in the water.

Instead, what you have to do is save the Foot, and it cascades down and saves the toe.



Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>