4647484950515253
try { em.persist(user); return user.getId(); } catch (Exception e) { logger.log(Level.INFO, "Unable to create a user {0}.", user); throw new UserDAOException(); } }
5657585960616263
public void deleteUser(User user) throws UserDAOException { try { em.remove(user); } catch (Exception e) { logger.log(Level.INFO, "Unable to delete a user {0}.", user); throw new UserDAOException(); } }
7374757677787980
} else { return null; } } catch (Exception ex) { logger.log(Level.INFO, ex.getMessage()); throw new UserDAOException(); } }
8889909192939495
q.setParameter("password", user.getPassword()); List<?> result = q.getResultList(); return result.size() == 1; } catch(Exception ex) { logger.log(Level.INFO, ex.getMessage()); throw new UserDAOException(); } }