jdaugherty commented on code in PR #15122:
URL: https://github.com/apache/grails-core/pull/15122#discussion_r2426913237


##########
grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/events/AutoTimestampEventListener.java:
##########
@@ -190,13 +195,15 @@ protected void 
storeDateCreatedAndLastUpdatedInfo(PersistentEntity persistentEnt
                     } else if 
(property.getName().equals(DATE_CREATED_PROPERTY)) {
                         storeTimestampAvailability(entitiesWithDateCreated, 
persistentEntity, property);
                     } else {
-                        Field field = 
getFieldFromHierarchy(persistentEntity.getJavaClass(), property.getName());
-                        if (field != null && 
field.isAnnotationPresent(AutoTimestamp.class)) {
-                            AutoTimestamp autoTimestamp = 
field.getAnnotation(AutoTimestamp.class);
-                            if (autoTimestamp.value() == 
AutoTimestamp.EventType.UPDATED) {
-                                
storeTimestampAvailability(entitiesWithLastUpdated, persistentEntity, property);
-                            } else {
-                                
storeTimestampAvailability(entitiesWithDateCreated, persistentEntity, property);
+                        Field field = 
ReflectionUtils.findField(persistentEntity.getJavaClass(), property.getName());

Review Comment:
   If we're trying to target a bug fix, why switch to a different method of 
resolution?  



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to