HQL 如何使用多条件 select 来自 table 的记录

HQL How to select records from table with multicondidions

你好,我想 select 来自 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"

如果有人可以为我声明准备查询,我将非常高兴

这是你想要的吗?

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