日期:2014-05-18 浏览次数:20641 次
String hql=" update News news set news.del=0 where news.id in ("+idlist+")";
HibernateTemplate ht =this.getHibernateTemplate();
List<News> list=ht.find(hql);
Session session=this.getHibernateTemplate().getSessionFactory().openSession();
try{
session.createSQLQuery("sql语句").executeUpdate();
}finally {
this.releaseSession(session);
}