Search in sources :

Example 6 with StateType

use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.StateType in project cals-api by ca-cwds.

the class PlacementHomeEntityAwareDTOBuilder method prepareOutOfStateChecks.

private void prepareOutOfStateChecks(OtherAdultDTO otherAdultDTO, OtherAdultInHomeEntityAwareDTO entityAwareDTO) {
    if (otherAdultDTO.getRfa1bForm() != null && CollectionUtils.isNotEmpty(otherAdultDTO.getRfa1bForm().getOtherStatesOfLiving())) {
        for (StateType state : otherAdultDTO.getRfa1bForm().getOtherStatesOfLiving()) {
            OutOfStateCheck outOfStateCheck = new OutOfStateCheck();
            outOfStateCheck.setStateC((short) state.getCwsId());
            entityAwareDTO.addOutOfStateCheck(outOfStateCheck);
        }
    }
}
Also used : StateType(gov.ca.cwds.cals.persistence.model.calsns.dictionaries.StateType)

Example 7 with StateType

use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.StateType in project cals-api by ca-cwds.

the class StateReferentialIntegrityValidator method getPersistentObject.

@Override
protected <T extends PersistentObject> PersistentObject getPersistentObject(Session currentSession, T obj, Serializable primaryKey) {
    PersistentObject found;
    Query<StateType> query = currentSession.createNamedQuery(NAMED_QUERY_FIND_STATE_BY_CODE, StateType.class);
    query.setParameter("stateCode", primaryKey);
    found = query.uniqueResult();
    return found;
}
Also used : StateType(gov.ca.cwds.cals.persistence.model.calsns.dictionaries.StateType) PersistentObject(gov.ca.cwds.data.persistence.PersistentObject)

Aggregations

StateType (gov.ca.cwds.cals.persistence.model.calsns.dictionaries.StateType)7 ApplicantDTO (gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO)4 RFA1aFormDTO (gov.ca.cwds.cals.service.dto.rfa.RFA1aFormDTO)4 RFA1bFormDTO (gov.ca.cwds.cals.service.dto.rfa.RFA1bFormDTO)3 PersistentObject (gov.ca.cwds.data.persistence.PersistentObject)2 Response (javax.ws.rs.core.Response)2 Test (org.junit.Test)2 JsonProperty (com.fasterxml.jackson.annotation.JsonProperty)1 REQUIRED_APPLICANT_DATE_OF_BIRTH (gov.ca.cwds.cals.Constants.Validation.Business.Code.REQUIRED_APPLICANT_DATE_OF_BIRTH)1 REQUIRED_APPLICANT_DRIVER_LICENSE_NUMBER (gov.ca.cwds.cals.Constants.Validation.Business.Code.REQUIRED_APPLICANT_DRIVER_LICENSE_NUMBER)1 REQUIRED_APPLICANT_DRIVER_LICENSE_STATE (gov.ca.cwds.cals.Constants.Validation.Business.Code.REQUIRED_APPLICANT_DRIVER_LICENSE_STATE)1 REQUIRED_APPLICANT_OTHER_NAMES_FIRST_NAME (gov.ca.cwds.cals.Constants.Validation.Business.Code.REQUIRED_APPLICANT_OTHER_NAMES_FIRST_NAME)1 REQUIRED_APPLICANT_OTHER_NAMES_LAST_NAME (gov.ca.cwds.cals.Constants.Validation.Business.Code.REQUIRED_APPLICANT_OTHER_NAMES_LAST_NAME)1 REQUIRED_APPLICANT_PHONE_NUMBER (gov.ca.cwds.cals.Constants.Validation.Business.Code.REQUIRED_APPLICANT_PHONE_NUMBER)1 REQUIRED_BODY_OF_WATER_EXIST_FIELD (gov.ca.cwds.cals.Constants.Validation.Business.Code.REQUIRED_BODY_OF_WATER_EXIST_FIELD)1 REQUIRED_HOME_LANGUAGES (gov.ca.cwds.cals.Constants.Validation.Business.Code.REQUIRED_HOME_LANGUAGES)1 REQUIRED_MINOR_CHILD_ADOPTED (gov.ca.cwds.cals.Constants.Validation.Business.Code.REQUIRED_MINOR_CHILD_ADOPTED)1 REQUIRED_MINOR_CHILD_DATE_OF_BIRTH (gov.ca.cwds.cals.Constants.Validation.Business.Code.REQUIRED_MINOR_CHILD_DATE_OF_BIRTH)1 REQUIRED_MINOR_CHILD_FINANCIALLY_SUPPORTED (gov.ca.cwds.cals.Constants.Validation.Business.Code.REQUIRED_MINOR_CHILD_FINANCIALLY_SUPPORTED)1 REQUIRED_MINOR_CHILD_GENDER (gov.ca.cwds.cals.Constants.Validation.Business.Code.REQUIRED_MINOR_CHILD_GENDER)1