Пример #1
0
 @Transactional(readOnly = true)
 @Override
 public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
   User user = userRepository.findByUsername(username);
   if (user == null) {
     throw new UsernameNotFoundException("The username could not be found on database.");
   }
   return user;
 }
Пример #2
0
 @Transactional(readOnly = true)
 @Override
 public User findSystemUser() {
   return userRepository.findByUsername(SYSTEM_LOGIN);
 }
Пример #3
0
 @Transactional(readOnly = true)
 @Override
 public User findByUsername(String username) {
   return userRepository.findByUsername(username);
 }