groovy - How to fix "identifier of an instance of X was altered from 2 to null" in grails -
i have 2 domain classes in grails. 1 called book , other called author. book class looks this,
class book { string name static constraints = { name nullable:false } }
and author class:
class author { string name book book1 book book2 book book3 static constraints = { name nullable:false book1 nullable:false book2 nullable:true book3 nullable:true } }
ff create author 2 books , edit 1 book got following error:
identifier of instance of com.apps.book altered 2 null
how fix it? using grails 2.1.1 , sql server 2008.
try set null book2 , book3 properties before line authorinstance.properties = params
in update method this:
book2 = null book3 = null authorinstance.properties = params
Comments
Post a Comment