Given a domain class:
class Book {
def title
Author author
}
class Author {
def name
}
Given a book instance:
Author author = new Author(name: 'joe')
author.save()
Book book = new Book(author:author, title: 'groovy book')
book.save()
If I change the name of the author:
author.name = 'john'
Is the book considered dirty? or modified?
No, the book
is not considered dirty
in this case since the book
is already saved. Only the author
is considered dirty
. Given that no properties of the book
have changed and only a property of the author
has.