How to Return DTOs from Native Queries with Spring Data JPA
Автор: Thorben Janssen
Загружено: 2021-09-09
Просмотров: 39121
Описание:
When using Spring Data JPA, you are used to derived and custom queries that return the result in your preferred format. A typical example is a DTO projection, which is the most efficient one for read-only operations. To use it in a derived or custom JPQL query, you only need to change the return type of your repository method to your DTO class or interface. But when using a native query, some limitations make DTOs a little harder to use.
Links mentioned:
Composite Repositories – Extend your Spring Data JPA Repository: https://thorben-janssen.com/composite...
How to Use Named Queries with Spring Data JPA : https://thorben-janssen.com/spring-da...
Result Set Mapping: Constructor Result Mappings
https://thorben-janssen.com/result-se...
Like my channel? Subscribe!
➜ http://bit.ly/2cUsid8
Join the free Member Library:
https://goo.gl/dtyIIC
Read the accompanying post: https://thorben-janssen.com/spring-da...
Want to connect with me?
Blog: https://thorben-janssen.com/
Twitter: / thjanssen123
Facebook: / thorbenjanssenofficial
Linkedin: / thorbenjanssen
#SpringDataJPA #ReturnDTOs #NativeQuery
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: