I was stuck with the following situation:
My entities are related to each other, but in such a way that i could not use JPQL. I was forced to use native SQL. Now I w
You are almost there, but for the below parts
@SqlResultSetMapping and @NamedNativeQuery has to be
present in the Entity and not the value Object. In your case it should be in the MyEntity class and **not ** the MyVO class. This should resolve your exception.That will still not do. After you do the above, change the below
@NamedNativeQuery(name = "findAllDataMapping",
to
@NamedNativeQuery(name = "MyEntity.findAllDataMapping",
Finally, in some cases you need to be explicit in your definition of @ColumnResult(name = "userFirstName"). If it is a complex field like ZonedDateTime or Boolean you may have to explicity state @ColumnResult(name = "date_created", type = ZonedDateTime.class).
Hope that helps.