class Author {
String name
ArrayList<Book> books = []
static hasMany = [books: Book]
static mapping = {
books cascade: "all-delete-orphan"
}
}
The error occurs when I try to save the object. “java.io.NotSerializableException”. Any ideas? Do I need to implement Serializable in the class? If so, why?
Here is the solution: