---
title: "hibernate3批量删除记录"
author: "lichuhui"
date: "2009-06-24T15:21:15Z"
tags: []
slug: "hibernate3"
draft: false
lastmod: "2009-06-24T15:21:15Z"
id: 414181
url: "https://lichuhui.iteye.com/blog/414181"
---

```
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;
}
```