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);
}
}
}
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;
}
Aggregations