-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
has: votes-jirain: coreIssues in core supportIssues in core supportstatus: supersededAn issue that has been superseded by anotherAn issue that has been superseded by anothertype: enhancementA general enhancementA general enhancement
Description
Sebastian Staudt opened DATAJPA-1033 and commented
Currently there seems no (at least no obvious) way to mix projections and specifications.
class ExampleRepository extends JpaRepository<Example, Integer>, JpaSpecificationExecutor<Example> {
// Overriden from JpaRepository, just to show the whole picture
// Works without problems
@Override
List<Example> findAll();
// A bit odd, due to the "By", but works - see DATAJPA-680
List<ExampleProjection> findAllProjectedBy();
// Overriden from JpaRepository, just to show the whole picture
// Works without problems
@Override
List<Example> findAll(Specification<Example> spec);
// This would be great, but doesn't work.
List<ExampleProjection> findAllProjectedBy(Specification<Example> spec);
}A query method like the last above causes a java.util.NoSuchElementException inside org.springframework.data.jpa.repository.query.CriteriaQueryParameterBinder#bind during query. (Which may be another problem on its own.)
Affects: 2.0 M1 (Kay), 1.11 RC1 (Ingalls), 1.10.6 (Hopper SR6)
Issue Links:
- DATAJPA-393 Add support for QueryDSL projections in JPA repositories
Referenced from: pull request #430
107 votes, 96 watchers
Havoc2346, jwillebrands, mickeida, mmyersDE, juliuskrah and 57 more
Metadata
Metadata
Assignees
Labels
has: votes-jirain: coreIssues in core supportIssues in core supportstatus: supersededAn issue that has been superseded by anotherAn issue that has been superseded by anothertype: enhancementA general enhancementA general enhancement