[ https://issues.apache.org/jira/browse/GROOVY-7671?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17762219#comment-17762219 ]
Christopher Smith commented on GROOVY-7671: ------------------------------------------- If the ordering does matter, this is remarkably non-intuitive; I don't think I know of any other case in Java or Groovy where annotation ordering matters. Is that documented? > AnnotationCollector should be composable/inheritable > ---------------------------------------------------- > > Key: GROOVY-7671 > URL: https://issues.apache.org/jira/browse/GROOVY-7671 > Project: Groovy > Issue Type: Improvement > Affects Versions: 2.4.5 > Reporter: Christopher Smith > Priority: Major > Labels: annotations > > I am using annotation collectors to simplify configuration for JPA entities. > I would like to have something like this: > {code} > @AnnotationCollector > @Entity > @CompileStatic > @JsonIdentityInfo(property = "id", generator = > ObjectIdGenerators.PropertyGenerator.class) > @interface JpaTable {} > {code} > {code} > @AnnotationCollector > @JpaTable > @UuidId > @interface JpaMainEntity {} > {code} > However, {{@AnnotationCollector}} can't "roll up" annotations like this; if I > make {{JpaTable}} a Java annotation, then the {{@AnnotationCollector}} *on* > it is ignored, and if I make it a Groovy annotation, it's elided, and at > compile time the processor for {{JpaMainEntity}} complains that {{JpaTable}} > is not an annotation. > Instead, it would be helpful if the collector could operate recursively. This > might require reworking how the collector processor currently runs to > actually compile it as a {{.class}} instead of discarding it during > compilation. -- This message was sent by Atlassian Jira (v8.20.10#820010)