use of io.dropwizard.hibernate.UnitOfWork 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 io.dropwizard.hibernate.UnitOfWork in project cals-api by ca-cwds.
the class RFA1aFormService method create.
@UnitOfWork(CALSNS)
@Override
public RFA1aFormDTO create(RFA1aFormDTO formDTO) {
RFA1aForm form = new RFA1aForm();
rfa1aFomMapper.toRFA1aForm(form, formDTO);
String staffPersonId = PrincipalUtils.getStaffPersonId();
LocalDateTime now = LocalDateTime.now();
form.setCreateDateTime(now);
form.setCreateUserId(staffPersonId);
form.setUpdateDateTime(now);
form.setUpdateUserId(staffPersonId);
form.setStatus(RFAApplicationStatus.DRAFT);
form = rfa1AFormsDao.create(form);
return rfa1aFomMapper.toRFA1aFormDTO(form);
}
Aggregations