@SqlResultSetMapping
annotation should not be put on a POJO. Put it at (any) @Entity
class. “Unknown SqlResultSetMapping [foo]” tells you, that JPA provider doesn’t see any mapping under name ‘foo’. Please see another answer of mine for the correct example
- JPA- Joining two tables in non-entity class