Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.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/8/http/4.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
Jpa 获取列表中包含元素的所有项_Jpa - Fatal编程技术网

Jpa 获取列表中包含元素的所有项

Jpa 获取列表中包含元素的所有项,jpa,Jpa,我想选择参数列表中其列表所在的所有项目。你能帮助我吗?提前谢谢。这是我的代码,但不起作用: @Query("select * from Room r where exists(select * from Room r1 join r1.equipments e where e in :equipements)") select*仅适用于SQL。在JPQL中,您需要明确地列出您想要返回的内容。在这种情况下,请尝试从房间r中选择r。。然后从房间r1中选择r1。在尝试更复杂的subselect和ex

我想选择参数列表中其列表所在的所有项目。你能帮助我吗?提前谢谢。这是我的代码,但不起作用:

@Query("select * from Room r where exists(select * from Room r1 join r1.equipments e where e in :equipements)")

select*仅适用于SQL。在JPQL中,您需要明确地列出您想要返回的内容。在这种情况下,请尝试从房间r中选择r。。然后从房间r1中选择r1。在尝试更复杂的subselect和exist查询之前,先完成基本查询。事实上,这是一个错误。经过一些更改后,选择工作:@Queryselect r from Room r where exists select r1 from Room r1 join r1.e其中e in:equipments