Ejemplo n.º 1
0
  @Override
  public UserProfile getUserByEmail(String email) {
    try {
      UsersDAO usersDAO = new UsersDAO(connectionUsers);
      UsersDataSet userDataSet = usersDAO.getByEmail(email);

      UserProfile user =
          new UserProfile(
              userDataSet.getFirstName(),
              userDataSet.getLastName(),
              userDataSet.getEmail(),
              userDataSet.getAvatarUrl());
      user.setScore(userDataSet.getScore());
      return user;
    } catch (SQLException e) {
      e.printStackTrace();
    }
    return null;
  }