Пример #1
0
  private static UserTO buildUserTO(User user) {
    UserTO userTO = new UserTO();

    userTO.setUserName(user.getUserName());
    userTO.setFirstName(user.getFirstName());
    userTO.setLastName(user.getLastName());

    return userTO;
  }
Пример #2
0
  @Override
  public void save(UserTO user) throws ValidationException {
    User entity = new User();

    entity.setUserId(new Random().nextInt());
    entity.setUserName(user.getUserName());
    entity.setFirstName(user.getFirstName());
    entity.setLastName(user.getLastName());

    usersDAO.save(entity);
  }