Class UserService


  • public final class UserService
    extends Object
    Service class of a user
    Author:
    Laurent Payen
    • Method Detail

      • saveUser

        public static User saveUser​(AppointmentDTO appointment)
        Save a user in database / A user is defined by its email (unique)
        Parameters:
        appointment - the appointment DTO
        Returns:
        the user saved
      • findUserById

        public static User findUserById​(int nIdUser)
        Find a User by its primary key
        Parameters:
        nIdUser - the primary key
        Returns:
        the User found
      • findUserByFirstNameLastNameAndEmail

        public static User findUserByFirstNameLastNameAndEmail​(String strFirstName,
                                                               String strLastName,
                                                               String strEmail)
        Find a user by its first name, last name and email
        Parameters:
        strFirstName - the first name
        strLastName - the last name
        strEmail - the email
        Returns:
        the user
      • findUsersByEmail

        public static List<User> findUsersByEmail​(String strEmail)
        Find users by its email
        Parameters:
        strEmail - the email
        Returns:
        the user(s)