// 删除消息 public void deleteMessage(List<Message> message) { try { hibernateTemplate.deleteAll(message); } catch (Exception e) { System.out.println(e + "-----"); } }
@Transactional(readOnly = false) public void clearStats() { hibernateTemplate.deleteAll(hibernateTemplate.loadAll(Stat.class)); }
protected void delete(Class type) { HibernateTemplate t = getHibernateTemplate(); t.deleteAll(t.find("from " + type.getName())); }
@Override public int removeAll() throws InstanceNotFoundException { List<E> rows = getEntities(); ht.deleteAll(rows); return rows.size(); }