I have several Grails 2.1 domain classes that include dateCreated
and lastUpdated
fields that GORM manages automatically, eg:
class Person {
Date dateCreated
Date lastUpdated
String name
}
I want Grails to automatically fill in these fields at runtime, but I also want to create some test data where I can manually define the values of these dates. The trouble is that Grails automatically sets the values if these fields with an interceptor even when I have specifically set them.
I have seen this SO question which describes how to allow changes to dateCreated
, but I need to change lastUpdated
as well. Is this possible?
dateCreated
field manually but not thelastUpdated
field. – JoshlastUpdated
field just set as per usual? – Multifid