Говнокод #17
/**
* Delete. *
* @param entity the entity
* @return true, if successful
*/
public boolean delete(T entity) {
boolean deleted=false;
getSession().delete(entity);
flush();
//when no hibernate runtime exception has arised...set to true.
deleted = true;
return deleted;
}
ПЕРЕЙДИТЕ В ПОЛНУЮ ВЕРСИЮ
public boolean delete(T entity) {
boolean deleted=false;
try
{
getSession().delete(entity);
getSession().flush();
//when no hibernate runtime exception has arised...set to true.
deleted = true;
} catch(HibernateException e) {
System.out.println(«Hibernate error:» + e.getMessage());
}
return deleted;
}