My first choice where to put some @NamedNativeQueries is in the file where the data transfer object (a POJO, could be a record if I were using them) is defined. But the DTO isn’t an entity so Hibernate doesn't look at the file and the queries are not found. [If you are wondering, I use a @ConstructorResult in a @QueryResultSetMapping to create the objects.] I can put them in a different file with an @Entity but the semantics are wrong.
Is there any magic way to make Hibernate look at a file it otherwise would ignore?