Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 2.0.4
-
Component/s: Persistence
Description
When running unit tests, mocked domain classes don't persist the correct values for custom types within embedded entities. The save succeeds, but any custom type field (in my case a JodaTime LocalDate) is just written with null.
For example:
class Person {
String name
Birthday birthday
static embedded = ['birthday']
}
class Birthday {
LocalDate date
}
def person = new Person(name: "John Doe", birthday: new Birthday(date: LocalDate.now())).save()
person.birtday.date would be persisted with null.
I submitted a pull request (https://github.com/SpringSource/grails-data-mapping/pull/55) to grails-data-mapping to fix this issue.