Reputation: 1459
I am interested in Spring Data JPA projection but I need to use JPA specification. Is it possible to fetch projection interfaces with JPA specification?
Upvotes: 2
Views: 4894
Reputation: 2409
A Spring-Data-JPA Enthusiast has created a project that implements projections with specifications. I am using it in my own project without problem. You may check it from here:
https://github.com/pramoth/specification-with-projection
Update for database level projections
There is an outdated comment below.
Is not query optimized. It just map the results after they have been queried
The last version of this library supports database level projections link to the commit.
Update for the last Spring Boot versions
Until this pull request is not merged, to support the last Spring Boot versions, fixed library sources can be copy pasted directly to the project from here https://github.com/v-ladynev/specification-with-projection-embeded
Upvotes: 1
Reputation: 32535
As far as I know, this simply dooes not work and is not supposed to work, at least not for now https://jira.spring.io/browse/DATAJPA-1189
Upvotes: 2