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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.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
Hibernate HQL如何从具有多条件的表中选择记录_Hibernate_Hql - Fatal编程技术网

Hibernate HQL如何从具有多条件的表中选择记录

Hibernate HQL如何从具有多条件的表中选择记录,hibernate,hql,Hibernate,Hql,您好,我想从challengeEntity中选择HQL中的记录,其中un1等于a或b,un2等于a或b un1=a | | b&&un2=a | | b 这不适用于我的查询 "from ChallengeEntity c where c.un1=a||b and c.un2=a||b" 如果有人能为我声明prepar query,我将非常高兴这就是你想要的吗 from ChallengeEntity c where (c.un1=a or c.un1=b) and (c.un2=a or c

您好,我想从challengeEntity中选择HQL中的记录,其中un1等于a或b,un2等于a或b

un1=a | | b&&un2=a | | b

这不适用于我的查询

"from ChallengeEntity c where c.un1=a||b and c.un2=a||b"
如果有人能为我声明prepar query,我将非常高兴

这就是你想要的吗

 from ChallengeEntity c where (c.un1=a or c.un1=b) and (c.un2=a or c.un2=b)