I am trying to find information on how to select only specific fields of an object using Spring Data (I use JPA). I want to select only specific information about the entity, the repository interfaces give you ways to return the information of the WHOLE! Object. In some cases, I need only 2 or 3 fields of the object, and 20,30, ... 100 .. the fields can be a bit crowded.
This functionality is what I would do using Hibernate Criteria Projections forecasts or even JPA "SELECT NEW ...." queries. I don't know if this is possible using Spring data.
Thanks.
source share