java.lang.Object
no.ntnu.principes.service.DeletionService
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddeleteMember(Long memberId) Deletes a member and all associated data in the correct order.static voiddeleteTask(Long taskId) Deletes a task and all associated data in the correct order.
-
Constructor Details
-
DeletionService
public DeletionService()
-
-
Method Details
-
deleteMember
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
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
-