Class AdminWorkgroupDAO

    • Constructor Detail

      • AdminWorkgroupDAO

        public AdminWorkgroupDAO()
    • Method Detail

      • insert

        public void insert​(AdminWorkgroup workgroup)
        Insert a new record in the table.
        Specified by:
        insert in interface IAdminWorkgroupDAO
        Parameters:
        workgroup - The workgroup object
      • load

        public AdminWorkgroup load​(String strWorkgroupKey)
        Load the data of AdminWorkgroup from the table
        Specified by:
        load in interface IAdminWorkgroupDAO
        Parameters:
        strWorkgroupKey - The workgroup key
        Returns:
        the instance of the AdminWorkgroup
      • delete

        public void delete​(String strWorkgroupKey)
        Delete a record from the table
        Specified by:
        delete in interface IAdminWorkgroupDAO
        Parameters:
        strWorkgroupKey - The workgroup key
      • store

        public void store​(AdminWorkgroup workgroup)
        Update the record identified by the given workgroup key with the given workgroup in the table
        Specified by:
        store in interface IAdminWorkgroupDAO
        Parameters:
        workgroup - The reference of workgroup to be the new one
      • checkExistWorkgroup

        public boolean checkExistWorkgroup​(String strWorkgroupKey)
        Check that the given key points to an existing workgroup
        Specified by:
        checkExistWorkgroup in interface IAdminWorkgroupDAO
        Parameters:
        strWorkgroupKey - The workgroup key
        Returns:
        true if the workgroup exists, false otherwise
      • isUserInWorkgroup

        public boolean isUserInWorkgroup​(int nIdUser,
                                         String strWorkgroupKey)
        Is the user member of the workgroup
        Specified by:
        isUserInWorkgroup in interface IAdminWorkgroupDAO
        Parameters:
        nIdUser - The user Id
        strWorkgroupKey - The workgroup key
        Returns:
        True if the user is in the workgroup, otherwise false
      • checkUserHasWorkgroup

        public boolean checkUserHasWorkgroup​(int nIdUser)
        Is the user member of the workgroup
        Specified by:
        checkUserHasWorkgroup in interface IAdminWorkgroupDAO
        Parameters:
        nIdUser - The user Id
        Returns:
        True if the user has workgroup
      • getUserWorkgroups

        public ReferenceList getUserWorkgroups​(int nIdUser)
        Returns the list of all workgroups the user is member
        Specified by:
        getUserWorkgroups in interface IAdminWorkgroupDAO
        Parameters:
        nIdUser - The user Id
        Returns:
        The list of all user's workgroups
      • deleteAllUsersForWorkgroup

        public void deleteAllUsersForWorkgroup​(String strWorkgroupKey)
        Remove all users of a workgroup
        Specified by:
        deleteAllUsersForWorkgroup in interface IAdminWorkgroupDAO
        Parameters:
        strWorkgroupKey - The workgroup key
      • insertUserForWorkgroup

        public void insertUserForWorkgroup​(AdminUser user,
                                           String strWorkgroupKey)
        Insert a user into a workgroup
        Specified by:
        insertUserForWorkgroup in interface IAdminWorkgroupDAO
        Parameters:
        user - The user to insert
        strWorkgroupKey - the key workgroup
      • deleteUserFromWorkgroup

        public void deleteUserFromWorkgroup​(int nUserId,
                                            String strWorkgroupKey)
        Remove an user from a workgroup
        Specified by:
        deleteUserFromWorkgroup in interface IAdminWorkgroupDAO
        Parameters:
        nUserId - The user ID
        strWorkgroupKey - The workgroup key