public AppSiteVo getSite() throws DomainInterfaceException { DomainFactory factory = getDomainFactory(); List list = factory.find("from AppSite"); if(list.size() > 1) { throw new ims.domain.exceptions.DomainInterfaceException("There is more than 1 record in core_appsite table !"); } if(list.size() == 1) return AppSiteVoAssembler.create((AppSite) list.get(0)); return null; }
/** * getSite */ public ims.core.vo.AppSiteVo getSite() throws ims.domain.exceptions.DomainInterfaceException { DomainFactory factory = getDomainFactory(); List list = factory.find("from AppSite"); if(list.size() > 1) { throw new ims.domain.exceptions.DomainInterfaceException("There is more than 1 record in core_appsite table !"); } if(list.size() == 1) return AppSiteVoAssembler.create((AppSite) list.get(0)); return null; }
/** * saveSite */ public ims.core.vo.AppSiteVo saveSite(ims.core.vo.AppSiteVo siteVo) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException { if (!siteVo.isValidated()) { throw new DomainRuntimeException("AppSiteVo has not been validated"); } DomainFactory factory = getDomainFactory(); if(siteVo.getID_AppSite() == null) { //there must be only one record List list = factory.find("from AppSite"); if(list.size() > 0) { throw new ims.domain.exceptions.DomainInterfaceException("There is already one record in core_appsite table !"); } } AppSite domAppSite = AppSiteVoAssembler.extractAppSite(factory, siteVo); factory.save(domAppSite); return AppSiteVoAssembler.create(domAppSite); }
public AppSiteVo getSite() { DomainFactory factory = getDomainFactory(); List list = factory.find("from AppSite"); if(list.size() > 0) return AppSiteVoAssembler.create((AppSite) list.get(0)); return null; }