如何将stream作为where子句与Spring数据jpa一起使用?
我正在springboot应用程序中使用如何将stream作为where子句与Spring数据jpa一起使用?,spring,spring-boot,java-8,spring-data-jpa,Spring,Spring Boot,Java 8,Spring Data Jpa,我正在springboot应用程序中使用org.springframework.boot:springbootstarter数据jpa:1.5.4.RELEASE。我尝试了一些使用查询生成器功能构建查询的场景。例如 @Query(value="select new Foo(b.name) from Bar b where b.id IN (:ids)") Stream<Foo> findByIdIn(@Param("ids")List<String> ids); @Qu
org.springframework.boot:springbootstarter数据jpa:1.5.4.RELEASE
。我尝试了一些使用查询生成器功能构建查询的场景。例如
@Query(value="select new Foo(b.name) from Bar b where b.id IN (:ids)")
Stream<Foo> findByIdIn(@Param("ids")List<String> ids);
@Query(value=“从b栏中选择新的Foo(b.name),其中b.id位于(:id)”)
流findByIdIn(@Param(“ids”)列表id);
可以在where子句中使用流吗?类似于eg-流findByIdIn(流ID)
。如果可能的话,我应该如何在@Query中更改:id
有人能给我举个例子吗?据我所知,没有。不能,但可以作为流返回。将参数类型更改为
流时会发生什么情况?