use of gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aForm 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);
}
use of gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aForm in project cals-api by ca-cwds.
the class RFA1aFormsDao method findAll.
/**
* Find all RFA1a forms.
*
* @param maxResults expected maximum results
* @return List of RFA1aForm
*/
public List<RFA1aForm> findAll(int maxResults) {
Session session = this.getSessionFactory().getCurrentSession();
Query<RFA1aForm> query = session.createNamedQuery(RFA1aForm.NAMED_QUERY_FIND_ALL, RFA1aForm.class);
query.setMaxResults(maxResults);
ImmutableList.Builder<RFA1aForm> entities = new ImmutableList.Builder<>();
entities.addAll(query.list());
return entities.build();
}
use of gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aForm in project cals-api by ca-cwds.
the class ApplicantNamesDuplicationConstraintPostConfiguration method getValidatedFact.
@Override
public RFA1aForm getValidatedFact(Object[] input) {
BusinessValidationParameterObject<ApplicantDTO> parameterObject = getBusinessValidationParameterObject(input);
RFA1aForm form = getFormDao().find(parameterObject.getFormId());
return buildModifiedForm(form, parameterObject.getEntityDTO());
}
Aggregations