use of gov.ca.cwds.cals.persistence.model.lisfas.LisTableFile in project cals-api by ca-cwds.
the class LisFacilityService method attachVisitsData.
@UnitOfWork(LIS)
void attachVisitsData(FacilityInformation facilityInformation) {
Long facilityLastVisitReasonCode = facilityInformation.getFacLastVisitReason();
if (facilityLastVisitReasonCode != null) {
LisTableFile facilityLastVisitReason = lisTableFileDao.findVisitReasonType(facilityLastVisitReasonCode.intValue());
facilityInformation.setFacilityLastVisitReason(facilityLastVisitReason);
}
Long facilityLastDeferredVisitReasonCode = facilityInformation.getFacLastDeferVisitReason();
if (facilityLastDeferredVisitReasonCode != null) {
LisTableFile facilityLastDeferredVisitReason = lisTableFileDao.findVisitReasonType(facilityLastDeferredVisitReasonCode.intValue());
facilityInformation.setFacilityLastDeferredVisitReason(facilityLastDeferredVisitReason);
}
}
use of gov.ca.cwds.cals.persistence.model.lisfas.LisTableFile in project cals-api by ca-cwds.
the class LisFacilityService method findLisFacilityByLicenseNumber.
@UnitOfWork(LIS)
LisFacFile findLisFacilityByLicenseNumber(FacilityParameterObject parameterObject) {
LisFacFile lisFacFile = lisFacFileLisDao.find(Integer.valueOf(parameterObject.getFacilityId()));
if (lisFacFile == null) {
return null;
}
Integer countyCode = lisFacFile.getCountyCode();
if (countyCode != null) {
LisTableFile county = lisTableFileDao.findCounty(countyCode);
lisFacFile.setCounty(county);
}
Integer facilityStatusCode = lisFacFile.getFacilityStatusCode();
if (facilityStatusCode != null) {
LisTableFile facilityStatus = lisTableFileDao.findFacilityStatus(facilityStatusCode);
lisFacFile.setFacilityStatus(facilityStatus);
}
Integer facilityTypeCode = lisFacFile.getFacilityTypeCode();
if (facilityTypeCode != null) {
LisTableFile facilityType = lisTableFileDao.findFacilityType(facilityTypeCode);
lisFacFile.setFacilityType(facilityType);
}
return lisFacFile;
}
use of gov.ca.cwds.cals.persistence.model.lisfas.LisTableFile in project cals-api by ca-cwds.
the class LisTableFileDao method getLisTableFile.
private LisTableFile getLisTableFile(String paramName, Integer paramCode, String querySuffix) {
Session session = getSessionFactory().getCurrentSession();
Class<LisTableFile> entityClass = getEntityClass();
Query<LisTableFile> query = session.createNamedQuery(entityClass.getSimpleName() + querySuffix, entityClass);
query.setParameter(paramName, paramCode);
LisTableFile lisTableFile = null;
try {
lisTableFile = query.getSingleResult();
} catch (NoResultException e) {
LOG.warn("There is no result for {} = {}", paramName, paramCode);
LOG.debug(e.getMessage(), e);
}
return lisTableFile;
}
Aggregations