Spring 将提供的queryDSL谓词与预定义查询相结合

Spring 将提供的queryDSL谓词与预定义查询相结合,spring,spring-data-rest,Spring,Spring Data Rest,在SpringDataREST的上下文中,我想对单个查询的结果公开搜索/过滤功能。 如果我的查询是findAll,那就开箱即用了,这就足以扩展QueryDslPredicateExecutor。但是,如何将自定义查询findSynotes与用户提供的标记为“完成”的附加筛选结合起来呢。我的意思是: @Entity class Note { @Id private UUID id; private UUID personId; private String stat

在SpringDataREST的上下文中,我想对单个查询的结果公开搜索/过滤功能。 如果我的查询是findAll,那就开箱即用了,这就足以扩展QueryDslPredicateExecutor。但是,如何将自定义查询findSynotes与用户提供的标记为“完成”的附加筛选结合起来呢。我的意思是:

@Entity
class Note {
    @Id
    private UUID id;
    private UUID personId;
    private String status;
    private String text;
}

@RepositoryRestResource(path = "notes", itemResourceRel = "notes", collectionResourceRel = "notes")
interface NoteRepository extends JpaRepository<Note, UUID>, QueryDslPredicateExecutor<Note> {

    @RestResource(path="notes/my")
    @Query("select n from Note n where n.personId=:creatorId")
    Page<Note> findDone(@Param("creatorId") UUID creatorId, Predicate predicate, Pageable pageable);
}
我从盒子里什么也没找到。因此,我考虑使用AOP和:

是否有多条路径多个@RestResource?该映射到org.springframework.data.querydsl.querydsl谓词执行器FindAllPredicate,org.springframework.data.domain.Pageable 在我的示例中,我有自己的注释,可以指向返回@Query的原始queryDSL谓词内容的方法 通过AOP计算这两个谓词的和,并将其作为参数传递给findAll方法 问题是,除了在servlet过滤器中对其进行黑客攻击之外,我不知道如何做第一点——将多个路径映射到同一个findAll方法


或者,是否有我遗漏的现成的解决方案?

您找到解决方案了吗?