Spring Data JPA NamedNativeQuery with SqlResultSetMapping and externalized query

168 views Asked by At

I have a situation where I am making a read request to a database with a long, complex query that needs to map to a complex object. Based on my research, it looks like I want to use @SqlResultSetMapping to handle the mapping, but I would like to put my query into the jpa-named-queries.properties file because it is so long. I can only find examples of @SqlResultSetMapping with @NamedNativeQuery that shows the query passed into the query parameter of the annotation as a string. Is it possible to use @SqlResultSetMapping with an externalized query, and if so, can anyone provide and example of how to do this? Thanks!

0

There are 0 answers