I struck a problem while upgrading a project to Grails 4.0.10 where the metaClass.hasProperty mechanism used previously seems to always return null. I think the timestamps were actually being set by some other Grails/GORM mechanism. With Grails 4.0.10 I started getting errors where it was trying to insert null into the not-null date_created column.
The change I'm proposing uses the GORM PersistentEntity for the domain class to find the datatype of the timestamp properties, which is more akin to what Grails/GORM does.
The changes in build.gradle are what I had to do to get the project to build locally, I don't know if they're necessary in all environments.
I struck a problem while upgrading a project to Grails 4.0.10 where the
metaClass.hasProperty
mechanism used previously seems to always returnnull
. I think the timestamps were actually being set by some other Grails/GORM mechanism. With Grails 4.0.10 I started getting errors where it was trying to insert null into the not-nulldate_created
column.The change I'm proposing uses the GORM
PersistentEntity
for the domain class to find the datatype of the timestamp properties, which is more akin to what Grails/GORM does.The changes in
build.gradle
are what I had to do to get the project to build locally, I don't know if they're necessary in all environments.