How to return boolean result in Java 🤗
1 2 3 4 5 6 7 8 9 10 11 12 13 |
/** * 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; } |