/** * {@inheritDoc} */ public void saveToRecycleBin(XWikiAttachment attachment, String deleter, Date date, XWikiContext context, boolean bTransaction) throws XWikiException { final DeletedAttachment trashAtachment = new DeletedAttachment(attachment, deleter, date, context); executeWrite(context, bTransaction, new HibernateCallback<Object>() { public Object doInHibernate(Session session) throws HibernateException { session.save(trashAtachment); return null; } }); }
if (databaseId != null) { dbAttachment = new DeletedAttachment(docId, this.serializer.serialize(documentReference), filename, FileSystemStoreUtils.HINT, deleter, deleteDate, null, databaseId); session.update(dbAttachment); } else { dbAttachment = new DeletedAttachment(docId, this.serializer.serialize(documentReference), filename, FileSystemStoreUtils.HINT, deleter, deleteDate, null); databaseId = (Long) session.save(dbAttachment);