示例#1
0
  @Transactional(readOnly = false, rollbackFor = Exception.class)
  @Override
  public User delete(Long id) throws Exception {
    LOGGER.debug("User delete(Long id): " + id);

    User user = userRepository.findOne(id);

    if (user == null) {
      LOGGER.debug("No user found with id: " + id);
      throw new Exception();
    }

    userRepository.delete(user);
    return user;
  }