@Override
String hql =" from A c where c.statusCode in (:stList) and c.snId in (:snIdList)";
Session session = super.getSession();
Query query = session.createQuery(hql.toString());
query.setParameterList("stList", stList);
query.setParameterList("snIdList", snIdList);
//query.setMaxResults(300);// 如限制查询结果的数量,可加该语句;一次查询处理多少数据
return query.list();
}
(二)更新操作
Action层:
A a = new A();
updateAList .add(a);
mxzerService.updateA(updateAList);
updateAList.clear(); // 清理一次
Service + Dao层:
@Override
mxzerDao.updateA(aList);
}
dao层:
public class aImpl extends BaseDao implements IADao{}
@Override
super.saveOrUpdateByBatch(aList, 500); //一次要更新多少条数据
}
(三)删除操作
(四)新增操作