int delete(String query, Object value, Type type) {
int deleted = 0;
try {
// old: deleted = getSession().delete(query, value, type);
Session si = getSession();
Query qu = si.createQuery(query);
qu.setParameter(0, value, type);
List foundToDel = qu.list();
int deletionCount = foundToDel.size();
for (int i = 0; i < deletionCount; i++ ) {
si.delete( foundToDel.get(i) );