我有下面这样的table
id, employee_no, survey_no, name
1 test 1 test_name
2 test2 1 test_name2
3 test3 1 test_name3
4 test4 2 test_name4
如何通过将下面的AND组合成一个in语句来查询Restriction.in?
IN[ (if(survey_no==1) && employee_no== 'test') ,
(if(survey_no==1) && employee_no== 'test2') ,
...
]
3条答案
按热度按时间uwopmtnx1#
我认为这是您想要使用的条件组合(顺便说一句,帮助定义Hibernate实体bean比帮助定义表结构更容易):
fwzugrvs2#
nbysray53#
我遇到了同样的问题,我已将所有ID存储在stringBuilder中,但当我尝试此方法时,它会给我一个错误,没有返回任何值,请帮助我解决此问题。