public int clearAllPartsByKey(List<BigDecimal> keys,User user) {
System.out.println("keys::"+keys);
List<BigDecimal> ids = keys;
Session session=sessionFactory.getCurrentSession();
String hql = "delete from Part where id in (:ids)";//+id;
Query query = session.createQuery(hql);
query.setParameter("ids", ids); //一条数据
query.setParameterList("ids", ids); //多条数据
int result = query.executeUpdate();
return result;
}
网友评论