use of gov.ca.cwds.cals.persistence.model.fas.LpaInformation in project cals-api by ca-cwds.
the class LpaInformationDao method findByLpaCode.
public LpaInformation findByLpaCode(String lpaCode) {
Session session = getSessionFactory().getCurrentSession();
Class<LpaInformation> entityClass = getEntityClass();
Query<LpaInformation> query = session.createNamedQuery(LpaInformation.FIND_ASSIGNED_WORKER_BY_LPA_CODE, entityClass);
query.setParameter(LpaInformation.PARAM_LPA_CODE, lpaCode);
LpaInformation res = null;
try {
res = query.getSingleResult();
} catch (NoResultException e) {
LOG.warn("There is no result for lpaCode: {}", lpaCode);
LOG.debug(e.getMessage(), e);
}
return res;
}
use of gov.ca.cwds.cals.persistence.model.fas.LpaInformation in project cals-api by ca-cwds.
the class LisFacilityService method loadFacilityFromLis.
/**
* Load facility from LIS.
*/
public FacilityDTO loadFacilityFromLis(FacilityParameterObject parameterObject) {
LisFacFile lisDsLisFacFile = findLisFacilityByLicenseNumber(parameterObject);
if (lisDsLisFacFile == null) {
LOGGER.warn("!!!Facility was not found in LIS by license number {}", parameterObject.getFacilityId());
return null;
}
LpaInformation lpaInformation = lisDsLisFacFile.getFacDoEvalCode() != null ? fasFacilityService.findAssignedWorkerInformation(lisDsLisFacFile) : null;
return facilityMapper.toFacilityDTO(lisDsLisFacFile, lpaInformation);
}
Aggregations