Пример #1
0
 public List<User> findByName(String search) {
   return userDAO.findByCriteria(Restrictions.ilike("name", search, MatchMode.ANYWHERE));
 }
Пример #2
0
 public User findByEmail(String email) {
   List<User> result = userDAO.findByCriteria(Restrictions.eq("email", email));
   if (result.isEmpty()) return null;
   return result.get(0);
 }
Пример #3
0
 public User findByLogin(String login) {
   List<User> result = userDAO.findByCriteria(Restrictions.like("login", login));
   if (result.isEmpty()) return null;
   return result.get(0);
 }
Пример #4
0
 public User findById(Long id) {
   return userDAO.findById(id);
 }
Пример #5
0
 public void delete(User user) {
   userDAO.delete(user);
 }
Пример #6
0
 public List<User> listAll() {
   return userDAO.listAll();
 }
Пример #7
0
 private void save(User user) {
   userDAO.save(user);
 }
Пример #8
0
 public int size() {
   return userDAO.listAll().size();
 }