ISection superiorSection = null; if (infoSection.getSuperiorInfoSection()!=null) { superiorSection = Cloner.copyInfoSection2ISection(infoSection.getSuperiorInfoSection()); superiorSection.setSite(site); }   IPersistentSection persistentSection = sp.getIPersistentSection();  ISection deletedSection = Cloner.copyInfoSection2ISection(infoSection); deletedSection.setSite(site);
public Boolean run(InfoSection infoSection) throws FenixServiceException {		try {			ISuportePersistente sp = SuportePersistenteOJB.getInstance();			ISite site = Cloner.copyInfoSite2ISite(infoSection.getInfoSite());			IPersistentSite persistentSite = sp.getIPersistentSite();			site=persistentSite.readByExecutionCourse(site.getExecutionCourse());			/* we may only delete non-initial sections *///			ISite completeSite = sp.getIPersistentSite().readByExecutionCourse(site.getExecutionCourse());//			InfoSection initialSection = Cloner.copyISection2InfoSection(completeSite.getInitialSection());//			if (initialSection.equals(infoSection)){//				throw new FenixServiceException("Initial Section");//			}						ISection superiorSection = null;						if (infoSection.getSuperiorInfoSection()!=null) {							superiorSection = Cloner.copyInfoSection2ISection(infoSection.getSuperiorInfoSection());							superiorSection.setSite(site);						}									IPersistentSection persistentSection = sp.getIPersistentSection();						ISection deletedSection = Cloner.copyInfoSection2ISection(infoSection);			deletedSection.setSite(site);			//			if (deletedSection == null) throw new FenixServiceException("non existing section");						Integer deletedSectionOrder = deletedSection.getSectionOrder();					    persistentSection.delete(deletedSection);			sp.confirmarTransaccao();			sp.iniciarTransaccao();									List sectionsReordered = persistentSection.readBySiteAndSection(site, superiorSection);			// persistentItem.readAllItemsBySection(section);					//only necessary if we reomve the open/close transaction from the service		//sectionsReordered.remove(deletedSection);						Iterator iterSections = sectionsReordered.iterator(); 						ISection section = null;			Integer sectionOrder = null;			while (iterSections.hasNext()) {							section = (ISection) iterSections.next();				sectionOrder = section.getSectionOrder();							if (sectionOrder.intValue() > deletedSectionOrder.intValue()) {								section.setSectionOrder(new Integer(sectionOrder.intValue() - 1));					persistentSection.lockWrite(section);				}			}														return new Boolean(true);			} catch (ExcepcaoPersistencia e) {			throw new FenixServiceException(e);   } }