My question is based on another post. How can I achieve the same with a native query? Native queries do not allow JPQL thus do not allow new instances either.
My POJ
If you are using a recent version of spring-data and also making use of the Repositories, I personally think that the answer from Itsallas leads to the right solution.
I actually did't now about (Spring Data) Projections yet and needed a moment to understand what he was showing in his example.
Therefore I just want to add a link to the Spring Data JPA - Reference Documentation, have a look at the Projections chapter.
Spring Data query methods usually return one or multiple instances of the aggregate root managed by the repository. However, it might sometimes be desirable to create projections based on certain attributes of those types. Spring Data allows modeling dedicated return types, to more selectively retrieve partial views of the managed aggregates.