hibernate hql in

List list = session.createQuery(
"select sg5.sg5005 from lhyq.entity.changed.Yssg5 sg5 where sg5.sg5002="
+ id).list();
List listOther = session.createQuery(
"select sg5.sg5007 from lhyq.entity.changed.Yssg5 sg5 where sg5.sg5002="
+ id).list();
if (list != null && list.size() > 0 && listOther != null
&& listOther.size() > 0) {
String strSQL = "from lhyq.entity.unchanged.Ysgyb gyb where gyb.gyb004 in (:codeList) or gyb.gyb003 in (:codeListOther) ";
return session.createQuery(strSQL).setParameterList("codeList",
list.toArray()).setParameterList("codeListOther",
listOther.toArray()).list();

你可能感兴趣的:(Hibernate)