I have two domain classes in grails. One is called Book and the other is called Author. My Book class looks like this,
class Book {
String name
static constraints = {
name nullable:false
}
}
And My 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 I create an author with two books and then edit it to one book I got the following error:
identifier of an instance of com.apps.Book was altered from 2 to null
How to fix it? I am using grails 2.1.1 and sql server 2008.