读书人

HQL 传接List或者数组类型

发布时间: 2012-08-31 12:55:03 作者: rapoo

HQL 传递List或者数组类型

public List<Integer> findUserIdByEmail(String[] emails) {List<Integer> results = new ArrayList<Integer>();String hql = "select userid from BnsProfile where email in (:addressarray) and emailstatus=" + Constants.USER_EMAIL_VERIFIED;Iterator iter = this.getSession().createQuery(hql).setParameterList("addressarray",emails).iterate();while(iter.hasNext()){Object obj = (Object)iter.next();results.add((Integer)obj);}return results;}

读书人网 >软件架构设计

热点推荐