예제 #1
0
 @Transactional(readOnly = true)
 public UserEntity getWithOrders(int id) {
   return repository.getByIdWithInitializedOrders(id);
 }
예제 #2
0
 public Collection<UserEntity> getAll() {
   return repository.findAll();
 }
예제 #3
0
 public void update(UserEntity user) {
   repository.save(user);
 }
예제 #4
0
 @Transactional(readOnly = true)
 public UserEntity getByEmail(String email) throws NotFoundException {
   Objects.requireNonNull(email, "Email must not be empty");
   return repository.getByEmail(email);
 }
예제 #5
0
 public UserEntity get(int id) throws NotFoundException {
   return repository.getOne(id);
 }
예제 #6
0
 public void delete(int id) throws NotFoundException {
   repository.delete(id);
 }
예제 #7
0
 public UserEntity save(UserEntity user) {
   return repository.save(user);
 }
예제 #8
0
 @Override
 public LoggedUser loadUserByUsername(String email) throws UsernameNotFoundException {
   UserEntity u = repository.getByEmail(email.toLowerCase());
   if (u == null) throw new UsernameNotFoundException("User " + email + " is not found");
   return new LoggedUser(u);
 }