Currently we say:
A class is considered eligible for generation of a metamodel class if
it **belongs to the persistence unit** and:
- it is annotated with a discoverable annotation type, or
- it has a method annotated with one of the two static query annotations,
@StaticQuery or @StaticNativeQuery.
And:
The set of types **belonging to a persistence unit** is determined by:
- classes bearing discoverable annotation types located in the root of the
persistence unit (unless <exclude-unlisted-classes/> is specified);
- one or more object/relational mapping XML files;
- one or more JAR files to be searched for classes;
- an explicit list of classes.
So a Jakarta Data repository does not "belong to the persistence unit" unless it's explicitly listed in persistence.xml or in an orm.xml, and therefore we are not required to generate a static metamodel for it, meaning it's @StaticQuery and @StaticNativeQuery annotations have no representation in the metamodel.
One fix would be to simply assert that @Repository is considered @Discoverable ... even though it's not annotated as such.
Also I think we should add Jakarta Data's @Query to the list of "static query annotations".
Currently we say:
And:
So a Jakarta Data repository does not "belong to the persistence unit" unless it's explicitly listed in
persistence.xmlor in anorm.xml, and therefore we are not required to generate a static metamodel for it, meaning it's@StaticQueryand@StaticNativeQueryannotations have no representation in the metamodel.One fix would be to simply assert that
@Repositoryis considered@Discoverable... even though it's not annotated as such.Also I think we should add Jakarta Data's
@Queryto the list of "static query annotations".