Back to Browse

Part 16 Spring Data Class/DTO Projections

461 views
Mar 1, 2024
7:02

DTO projections like interface based projections, provide a much better performance than entity projections as you don’t need to change the selected data. The goal of a DTO class is not only to provide an efficiency but also strongly typed representation of the data returned by the query. To use DTO projections with JPA, one must create a DTO class with a parameterized constructor that takes all attributes of a DTO. Also provide getter and setter methods for each of the attribute. These DTO types can be used in exactly the same way projection interfaces are used, except that no proxying happens and no nested projections can be applied.

Download

0 formats

No download links available.

Part 16 Spring Data Class/DTO Projections | NatokHD