Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将stream作为where子句与Spring数据jpa一起使用?_Spring_Spring Boot_Java 8_Spring Data Jpa - Fatal编程技术网

如何将stream作为where子句与Spring数据jpa一起使用?

如何将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

我正在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);
@Query(value=“从b栏中选择新的Foo(b.name),其中b.id位于(:id)”)
流findByIdIn(@Param(“ids”)列表id);
可以在where子句中使用流吗?类似于eg-
流findByIdIn(流ID)
。如果可能的话,我应该如何在@Query中更改:id


有人能给我举个例子吗?

据我所知,没有。不能,但可以作为流返回。将参数类型更改为
流时会发生什么情况?