ITeye博客

hibernate3批量删除记录

lichuhui · 2009-06-24 15:21 · Hibernate · Markdown

public int dropNews(Integer[] newsids) throws Exception {
        // TODO Auto-generated method stub
        String hql = "delete News  where n_id  in ( :newsids)";   
        Query query = this.getSession().createQuery(hql);   
        query.setParameterList("newsids",newsids);   
        int dels = query.executeUpdate();   
        return dels;
}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。