Class DeletionService

java.lang.Object
no.ntnu.principes.service.DeletionService

public class DeletionService extends Object
Service for safely deleting entities while maintaining database integrity. Handles proper deletion order for related records to prevent referential integrity issues. Implemented as utility methods with no instance state.
  • Constructor Details

    • DeletionService

      public DeletionService()
  • Method Details

    • deleteMember

      public static void deleteMember(Long memberId)
      Deletes a member and all associated data in the correct order. First removes points and task assignments linked to the member, then deletes the member record itself.
      Parameters:
      memberId - The ID of the member to delete
    • deleteTask

      public static void deleteTask(Long taskId)
      Deletes a task and all associated data in the correct order. First removes points earned for the task's assignments, then deletes the task assignments, and finally the task itself.
      Parameters:
      taskId - The ID of the task to delete