Session session = null;
Transaction ts = null;
try{
session = HibernateSessionFactory.getSession();
ts = session.beginTransaction();
News news = (News)session.get(News.class, new Integer("2"));
session.delete(news);
ts.commit();
} catch(Exception e) {
e.printStackTrace();
ts.rollback();
} finally{
session.close();
}
------解决方案--------------------
LZ试试看List listnew = newlist.findAllindex();输出的listnew内容是啥 有没有'2'条记录