Search in sources :

Example 1 with AssignmentInfoDTO

use of com.bigcrowd.noticeBoard.dto.AssignmentInfoDTO in project Notice-Board by FulvioFPimentel.

the class AssignmentService method updateAssignment.

@Transactional
public AssignmentInfoDTO updateAssignment(Long id, AssignmentInfoDTO dto) {
    Assignment assignment = assignmentRepository.getById(id);
    dtoToEntity(assignment, dto);
    assignment = assignmentRepository.saveAndFlush(assignment);
    return new AssignmentInfoDTO(assignment);
}
Also used : Assignment(com.bigcrowd.noticeBoard.entities.Assignment) AssignmentInfoDTO(com.bigcrowd.noticeBoard.dto.AssignmentInfoDTO) Transactional(org.springframework.transaction.annotation.Transactional)

Example 2 with AssignmentInfoDTO

use of com.bigcrowd.noticeBoard.dto.AssignmentInfoDTO in project Notice-Board by FulvioFPimentel.

the class AssignmentService method save.

@Transactional
public AssignmentInfoDTO save(AssignmentInfoDTO dto) {
    Assignment assignment = new Assignment();
    dtoToEntity(assignment, dto);
    assignment = assignmentRepository.saveAndFlush(assignment);
    return new AssignmentInfoDTO(assignment);
}
Also used : Assignment(com.bigcrowd.noticeBoard.entities.Assignment) AssignmentInfoDTO(com.bigcrowd.noticeBoard.dto.AssignmentInfoDTO) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

AssignmentInfoDTO (com.bigcrowd.noticeBoard.dto.AssignmentInfoDTO)2 Assignment (com.bigcrowd.noticeBoard.entities.Assignment)2 Transactional (org.springframework.transaction.annotation.Transactional)2