Search in sources :

Example 6 with Application

use of org.c4sg.entity.Application in project c4sg-services by Code4SocialGood.

the class ApplicationMapper method getApplicantDtosFromEntities.

public List<ApplicantDTO> getApplicantDtosFromEntities(List<Application> applications) {
    List<ApplicantDTO> applicantList = new ArrayList<ApplicantDTO>();
    ApplicantDTO applicant;
    for (Application application : applications) {
        applicant = new ApplicantDTO();
        applicant.setUserId(application.getUser().getId());
        applicant.setProjectId(application.getProject().getId());
        applicant.setFirstName(application.getUser().getFirstName());
        applicant.setLastName(application.getUser().getLastName());
        applicant.setTitle(application.getUser().getTitle());
        applicant.setApplicationStatus(application.getStatus());
        applicant.setComment(application.getComment());
        applicant.setResumeFlag(stringToBooleanConverter.convert(application.getResumeFlag()));
        applicant.setAppliedTime(application.getAppliedTime());
        applicant.setAcceptedTime(application.getAcceptedTime());
        applicant.setDeclinedTime(application.getDeclinedTime());
        applicantList.add(applicant);
    }
    return applicantList;
}
Also used : ArrayList(java.util.ArrayList) ApplicantDTO(org.c4sg.dto.ApplicantDTO) Application(org.c4sg.entity.Application)

Example 7 with Application

use of org.c4sg.entity.Application in project c4sg-services by Code4SocialGood.

the class ApplicationMapper method getProjectDtosFromApplicationEntities.

public List<ProjectDTO> getProjectDtosFromApplicationEntities(List<Application> applications) {
    List<ProjectDTO> projectList = new ArrayList<ProjectDTO>();
    Iterator<Application> applicationIter = applications.iterator();
    while (applicationIter.hasNext()) {
        Application application = applicationIter.next();
        projectList.add(getProjectDtoFromEntity(application));
    }
    return projectList;
}
Also used : ApplicationProjectDTO(org.c4sg.dto.ApplicationProjectDTO) ProjectDTO(org.c4sg.dto.ProjectDTO) ArrayList(java.util.ArrayList) Application(org.c4sg.entity.Application)

Aggregations

Application (org.c4sg.entity.Application)7 ArrayList (java.util.ArrayList)5 Project (org.c4sg.entity.Project)3 Timestamp (java.sql.Timestamp)2 ApplicationProjectDTO (org.c4sg.dto.ApplicationProjectDTO)2 User (org.c4sg.entity.User)2 ApplicantDTO (org.c4sg.dto.ApplicantDTO)1 ApplicationDTO (org.c4sg.dto.ApplicationDTO)1 ProjectDTO (org.c4sg.dto.ProjectDTO)1 UserOrganization (org.c4sg.entity.UserOrganization)1