java.lang.Object
no.ntnu.principes.mapper.TaskAssigmentMapper
Maps TaskAssignment domain objects to TaskAssignmentDto objects.
Provides optimized mapping for both single assignments and collections.
Uses batch loading for related entities when mapping multiple assignments.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TaskAssignmentDtomapAssignment(TaskAssignment assignment) Maps a single TaskAssignment to its DTO representation.static List<TaskAssignmentDto> mapAssignments(List<TaskAssignment> assignments) Maps a list of TaskAssignments to their DTO representations with optimized data loading.
-
Constructor Details
-
TaskAssigmentMapper
public TaskAssigmentMapper()
-
-
Method Details
-
mapAssignment
Maps a single TaskAssignment to its DTO representation. Fetches related task and member information to complete the mapping.- Parameters:
assignment- The task assignment to be mapped- Returns:
- The mapped DTO, or null if the related task cannot be found
-
mapAssignments
Maps a list of TaskAssignments to their DTO representations with optimized data loading. Prefetches all related members and tasks in two batch operations to avoid N+1 query issues.- Parameters:
assignments- The list of task assignments to be mapped- Returns:
- A list of mapped DTOs with complete task and member information
-