@Transactional @Override public Authentication create(UserAuth userAuth) throws UserNotFoundException { Authentication userAuthentication = new Authentication(); userAuthentication.setIdUser(userService.findByUserAuth(userAuth)); userAuthentication.setToken(new Integer(userAuth.getUsername().hashCode()).toString()); authenticationRepository.save(userAuthentication); return userAuthentication; }