How To Fetch DTO Via SqlResultSetMapping
And NamedNativeQuery
Description: Fetching more data than needed is prone to performance penalities. Using DTO allows us to extract only the needed data. In this application we rely on SqlResultSetMapping
, NamedNativeQuery
and EntityManager
.
Key points:
- use
SqlResultSetMapping
,NamedNativeQuery
andEntityManager
- for using Spring Data Projections check this item