public ims.admin.vo.OrganisationPCTLinkConfigVo save(ims.admin.vo.OrganisationPCTLinkConfigVo organisationPCTCodeConfig) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException { if (organisationPCTCodeConfig == null ) throw new CodingRuntimeException("Cannot save organisationPCTCodeConfig if null or get organisationPCTCodeConfig on null ID . "); if (!organisationPCTCodeConfig.isValidated()) throw new CodingRuntimeException("OrganisationPCTLinkConfigVo not Validated"); try { DomainFactory factory = getDomainFactory(); OrganisationPCTLinkConfig orgPctCode = OrganisationPCTLinkConfigVoAssembler.extractOrganisationPCTLinkConfig(factory, organisationPCTCodeConfig); factory.save(orgPctCode); return OrganisationPCTLinkConfigVoAssembler.create(orgPctCode); } catch (UnqViolationUncheckedException e) { throw new UniqueKeyViolationException("This Configuration Already Exist!", e); } }
public ims.admin.vo.OrganisationPCTLinkConfigVoCollection listOrganisationPCTCode() { DomainFactory factory = getDomainFactory(); String query = "from OrganisationPCTLinkConfig as orgPctCode"; List<?> organisationPCTList = factory.find(query); return OrganisationPCTLinkConfigVoAssembler.createOrganisationPCTLinkConfigVoCollectionFromOrganisationPCTLinkConfig(organisationPCTList); }
public OrganisationPCTLinkConfigVoCollection gePCTCodeForOrganisation(String organisation) { DomainFactory factory = getDomainFactory(); String query = "from OrganisationPCTLinkConfig as orgPctCode where orgPctCode.organisationCode = :organisation"; List<?> organisationPCTList = factory.find(query,new String[]{"organisation"} , new Object[] {organisation}); return OrganisationPCTLinkConfigVoAssembler.createOrganisationPCTLinkConfigVoCollectionFromOrganisationPCTLinkConfig(organisationPCTList); }
public void removeOrgPCTCode(OrganisationPCTLinkConfigVo orgPCTCode)throws ForeignKeyViolationException { if (orgPCTCode == null) throw new CodingRuntimeException("Cannot remove OrganisationPCTCode if null . "); DomainFactory factory = getDomainFactory(); OrganisationPCTLinkConfig domainOrgPCTCode = OrganisationPCTLinkConfigVoAssembler.extractOrganisationPCTLinkConfig(factory, orgPCTCode); factory.delete(domainOrgPCTCode); }