Hibernate转HQL为SQL的问题还是bug
String hql =
"from TUmpSendmsg
where
( dateint >=:yesterday or ((dateint=:dayBeforeYesterday and sendtime>=:now)) )
and
sendflag in ('1','3','4')
and
sendnum<repnum and retryflag='1'";
转成SQL后少了括号,如下
from UMP.T_UMP_SENDMSG tumpsendms0_
where
(DATEINT >= ? or DATEINT = ? and SENDTIME >= ?)//这里少了括号的话查询逻辑完全变了,求解
and
(tumpsendms0_.SENDFLAG in ('1', '3', '4'))
and
SENDNUM < tumpsendms0_.REPNUM
and
tumpsendms0_.RETRYFLAG = '1'
------解决方案--------------------这是没错的
从右向左解析 先解析 and 再解析Or