Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoTimestamp annotation support for non persistent super classes #2072

Open
wants to merge 1 commit into
base: 9.0.x
Choose a base branch
from

Conversation

codeconsole
Copy link
Contributor

Previously annotations would only be detected if the super class was another domain class.

This allows a domain class to have parent class that is not a domain class and still utilized the @AutoTimestamp annotation

e.g. this now works and does not work without this fix
src/main/groovy/example/Media.groovy

class Media {
     @AutoTimestamp Date modified
}

grails-app/domain/example/Image.groovy

class Image extends Media {
     String format
}

grails-app/domain/example/Video.groovy

class Media extends Media {
      int frames
}

Copy link
Contributor

@sbglasius sbglasius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good addition, but I would like to see an accompanying test to prove the correctness of the changed code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants