Type: New Feature
Affects Version/s: None
Fix Version/s: 1.10 M1 (Hopper)
It would be cool if we could leverage the projection support recently introduced in Spring Data CMNS
for custom queries in Spring Data JPA.
This would enable some interesting use cases:
1) A Projection interface could serve as a view for a domain object - by simply proxying it.
This could be either a JDK proxy with the actual entity as a target or a dynamically generated
class (e.g. via ASM) that is only backed by the properties from the target domain object.
Another valid option would be to use a dedicated DTO type here with properties matching those of the entity.
2) We could push down the defined properties on the projection interface down to the JPA query creation
which would then only fetch the values for the properties listed on said interface. This could then be based on 1).
For a user it could look like this:
I have a prototype for this working that I'll push in a bit.