Is it impossible to use class-based projection in Spring Data repository with native query? And how?
PS: I tried to use @Query(value = "select new package.Foo(id, name) from my_table, nativeQuery = true)
but it does not work.
I found the solution.
Need to use @SqlResultSetMapping
, ConstructorResult
and NamedNativeQuery
.