diff --git a/src/main/java/org/springframework/data/jpa/repository/support/FluentQuerySupport.java b/src/main/java/org/springframework/data/jpa/repository/support/FluentQuerySupport.java index d8cf79457..0bd878d02 100644 --- a/src/main/java/org/springframework/data/jpa/repository/support/FluentQuerySupport.java +++ b/src/main/java/org/springframework/data/jpa/repository/support/FluentQuerySupport.java @@ -40,6 +40,7 @@ abstract class FluentQuerySupport { protected final Class resultType; protected final Sort sort; + /** Properties on which the query projects. {@literal null} stands for no special projection. */ protected final @Nullable Set properties; protected final MappingContext, ? extends PersistentProperty> context; diff --git a/src/main/java/org/springframework/data/jpa/repository/support/QuerydslJpaPredicateExecutor.java b/src/main/java/org/springframework/data/jpa/repository/support/QuerydslJpaPredicateExecutor.java index 19ecfcf79..7f32ced6e 100644 --- a/src/main/java/org/springframework/data/jpa/repository/support/QuerydslJpaPredicateExecutor.java +++ b/src/main/java/org/springframework/data/jpa/repository/support/QuerydslJpaPredicateExecutor.java @@ -199,10 +199,16 @@ public class QuerydslJpaPredicateExecutor implements QuerydslPredicateExecuto return select; }; - FetchableFluentQueryByPredicate fluentQuery = new FetchableFluentQueryByPredicate<>(predicate, - entityInformation.getJavaType(), finder, pagedFinder, this::count, this::exists, - this.entityInformation.getJavaType(), - new JpaMetamodelMappingContext(Collections.singleton(this.entityManager.getMetamodel()))); + FetchableFluentQueryByPredicate fluentQuery = new FetchableFluentQueryByPredicate<>( // + predicate, // + entityInformation.getJavaType(), // + finder, // + pagedFinder, // + this::count, // + this::exists, // + this.entityInformation.getJavaType(), // + new JpaMetamodelMappingContext(Collections.singleton(this.entityManager.getMetamodel())) // + ); return queryFunction.apply((FetchableFluentQuery) fluentQuery); }