Search in sources :

Example 1 with RFA1aApplicant

use of gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aApplicant in project cals-api by ca-cwds.

the class LIC198bDao method createForApplicant.

public LIC198bForm createForApplicant(LIC198bForm entity, Long applicantId) {
    LIC198bForm created = super.create(entity);
    RFA1aApplicant rfa1aApplicant = applicantDao.find(applicantId);
    rfa1aApplicant.setLic198bForm(created);
    applicantDao.update(rfa1aApplicant);
    return created;
}
Also used : RFA1aApplicant(gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aApplicant) LIC198bForm(gov.ca.cwds.cals.persistence.model.calsns.rfa.LIC198bForm)

Example 2 with RFA1aApplicant

use of gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aApplicant in project cals-api by ca-cwds.

the class RFA1bDao method createForApplicant.

public RFA1bForm createForApplicant(RFA1bForm dto, Long applicantId) {
    RFA1bForm rfa1bFormEntity = super.create(dto);
    RFA1aApplicant rfa1aApplicant = applicantDao.find(applicantId);
    rfa1aApplicant.setRFA1bForm(rfa1bFormEntity);
    applicantDao.update(rfa1aApplicant);
    return rfa1bFormEntity;
}
Also used : RFA1bForm(gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1bForm) RFA1aApplicant(gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aApplicant)

Example 3 with RFA1aApplicant

use of gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aApplicant in project cals-api by ca-cwds.

the class RFA1bService method find.

public RFA1bFormDTO find(RFAExternalEntityUpdateParameterObject<RFA1bFormDTO> params) {
    if (params instanceof RFAApplicantAwareEntityUpdateParams) {
        Long applicantId = ((RFAApplicantAwareEntityUpdateParams) params).getApplicantId();
        RFA1aApplicant applicant = applicantDao.find(applicantId);
        return extractDTO(applicant.getRfa1bForm());
    } else if (params instanceof RFAOtherAdultAwareEntityUpdateParams) {
        Long otherAdultId = ((RFAOtherAdultAwareEntityUpdateParams) params).getOtherAdultId();
        RFA1aOtherAdult rfa1aOtherAdult = otherAdultDao.find(otherAdultId);
        return extractDTO(rfa1aOtherAdult.getRfa1bForm());
    }
    return null;
}
Also used : RFAApplicantAwareEntityUpdateParams(gov.ca.cwds.cals.web.rest.parameter.RFAApplicantAwareEntityUpdateParams) RFAOtherAdultAwareEntityUpdateParams(gov.ca.cwds.cals.web.rest.parameter.RFAOtherAdultAwareEntityUpdateParams) RFA1aOtherAdult(gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aOtherAdult) RFA1aApplicant(gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aApplicant)

Example 4 with RFA1aApplicant

use of gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aApplicant in project cals-api by ca-cwds.

the class ApplicantNamesDuplicationConstraintPostConfiguration method buildModifiedForm.

public RFA1aForm buildModifiedForm(RFA1aForm form, ApplicantDTO applicantDTO) {
    RFA1aApplicant newApplicant = new RFA1aApplicant();
    newApplicant.setApplicant(applicantDTO);
    Hibernate.initialize(form.getApplicants());
    getCurrentSession().detach(form);
    form.getApplicants().add(newApplicant);
    return form;
}
Also used : RFA1aApplicant(gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aApplicant)

Example 5 with RFA1aApplicant

use of gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aApplicant in project cals-api by ca-cwds.

the class LIC198bService method find.

public LIC198bFormDTO find(RFAExternalEntityUpdateParameterObject<RFA1bFormDTO> params) {
    if (params instanceof RFAApplicantAwareEntityUpdateParams) {
        Long applicantId = ((RFAApplicantAwareEntityUpdateParams) params).getApplicantId();
        RFA1aApplicant applicant = applicantDao.find(applicantId);
        return extractDTO(applicant.getLic198bForm());
    } else if (params instanceof RFAOtherAdultAwareEntityUpdateParams) {
        Long otherAdultId = ((RFAOtherAdultAwareEntityUpdateParams) params).getOtherAdultId();
        RFA1aOtherAdult rfa1aOtherAdult = otherAdultDao.find(otherAdultId);
        return extractDTO(rfa1aOtherAdult.getLic198bForm());
    }
    return null;
}
Also used : RFAApplicantAwareEntityUpdateParams(gov.ca.cwds.cals.web.rest.parameter.RFAApplicantAwareEntityUpdateParams) RFAOtherAdultAwareEntityUpdateParams(gov.ca.cwds.cals.web.rest.parameter.RFAOtherAdultAwareEntityUpdateParams) RFA1aOtherAdult(gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aOtherAdult) RFA1aApplicant(gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aApplicant)

Aggregations

RFA1aApplicant (gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aApplicant)5 RFA1aOtherAdult (gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aOtherAdult)2 RFAApplicantAwareEntityUpdateParams (gov.ca.cwds.cals.web.rest.parameter.RFAApplicantAwareEntityUpdateParams)2 RFAOtherAdultAwareEntityUpdateParams (gov.ca.cwds.cals.web.rest.parameter.RFAOtherAdultAwareEntityUpdateParams)2 LIC198bForm (gov.ca.cwds.cals.persistence.model.calsns.rfa.LIC198bForm)1 RFA1bForm (gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1bForm)1