codeconsole commented on code in PR #15122:
URL: https://github.com/apache/grails-core/pull/15122#discussion_r2427525226
##########
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:
@jdaugherty because it is does exactly same thing.
--
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]