@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; }
@Transactional(readOnly = true) @Override public User findSystemUser() { return userRepository.findByUsername(SYSTEM_LOGIN); }
@Transactional(readOnly = true) @Override public User findByUsername(String username) { return userRepository.findByUsername(username); }