public DementiaConfigurationVo save(DementiaConfigurationVo dementiaConfigToSave) throws StaleObjectException, UniqueKeyViolationException { if (dementiaConfigToSave == null) throw new CodingRuntimeException("Cannot save null DementiaConfiguration "); if (!dementiaConfigToSave.isValidated()) throw new DomainRuntimeException("DementiaConfiguration Not Validated."); if (isDementiaConfigurationRecorded(dementiaConfigToSave)) //WDEV-18743 throw new UniqueKeyViolationException("A dementia configuration record has already been saved. The screen will be refreshed."); DomainFactory factory = getDomainFactory(); DementiaConfiguration domainDementiaConfig = DementiaConfigurationVoAssembler.extractDementiaConfiguration(factory, dementiaConfigToSave); factory.save(domainDementiaConfig); return DementiaConfigurationVoAssembler.create(domainDementiaConfig); }
public DementiaConfigurationVo save(DementiaConfigurationVo dementiaConfigToSave) throws ims.domain.exceptions.StaleObjectException { if (dementiaConfigToSave == null) throw new CodingRuntimeException("Cannot save null DementiaConfiguration "); if (!dementiaConfigToSave.isValidated()) throw new DomainRuntimeException("DementiaConfiguration Not Validated."); DomainFactory factory = getDomainFactory(); DementiaConfiguration domainDementiaConfig = DementiaConfigurationVoAssembler.extractDementiaConfiguration(factory, dementiaConfigToSave); factory.save(domainDementiaConfig); return DementiaConfigurationVoAssembler.create(domainDementiaConfig); }
public ims.admin.vo.DementiaConfigurationVo getDementiaConfig() { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("from DementiaConfiguration as dementiaConfig"); List<?> list = factory.find(hql.toString()); if (list == null || list.size() == 0) return null; return DementiaConfigurationVoAssembler.create((DementiaConfiguration) list.get(0)); }