Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/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
Mysql 命名查询Hibernate中的Inverse子句_Mysql_Hibernate_Named Query_In Clause - Fatal编程技术网

Mysql 命名查询Hibernate中的Inverse子句

Mysql 命名查询Hibernate中的Inverse子句,mysql,hibernate,named-query,in-clause,Mysql,Hibernate,Named Query,In Clause,我需要完成这样的工作: @NamedQuery ( name="getEmployees", query="select object(em) from Employee em where ( :workingGroup in em.listOfWorkingGroup1 or :workingGroup in em.listOfWorkingGroup2 )" ) 我可以让它工作 我在

我需要完成这样的工作:

@NamedQuery (
   name="getEmployees",
   query="select object(em) from Employee em
          where (
              :workingGroup in em.listOfWorkingGroup1 or
              :workingGroup in em.listOfWorkingGroup2
          )"
)
我可以让它工作

我在一个名为
Employee
的实体中有两个列表,表示工作组

我想让所有员工在他们的两个工作组列表中有一个特定的工作组。(
workingGroup
是一个类,
listOfWorkingGroup1
listOfWorkingGroup1
workingGroup
的列表)


我怎样才能做到这一点呢?

请与
成员一起尝试

select object(em) from Employee em where :workingGroup member of em.listOfWorkingGroup1 or :workingGroup member of em.listOfWorkingGroup2

不客气。是的,你需要15个声望点才能获得投票权,但你可以接受答案(勾选)。你能试着更好地解释一下你想要实现的目标吗?这有点让人困惑?