public Object doInHibernate(Session session) throws HibernateException,
XWikiException
{</BUG>
assert doc != null;
<BUG>List<DeletedAttachment> lst =
session.createCriteria(DeletedAttachment.class).add(

Restrictions.eq("docId", doc.getId())).addOrder(Order.desc("date"))

.list();
DeletedAttachment[] result = new DeletedAttachment[lst.size()];
return lst.toArray(result);</BUG>
}

public Object doInHibernate(Session session) throws HibernateException,
XWikiException
{
try {
session.createQuery(
"delete from " + DeletedAttachment.class.getName() + " where id=?")
.setLong(0, index).executeUpdate();
} catch (Exception ex) {
}
return null;
}
