package pt.utl.ist.scripts.runOnce; import net.sourceforge.fenixedu.domain.SchoolClass; import pt.ist.fenixframework.FenixFramework; import pt.utl.ist.scripts.commons.AtomicScript; public class DeleteInconsistentSchoolClasses extends AtomicScript { public static void main(String[] args) { processWriteTransaction(new DeleteInconsistentSchoolClasses()); } @Override protected void run() throws Exception { SchoolClass schoolClass; schoolClass = FenixFramework.getDomainObject("2314987440496"); if (schoolClass.getAnoCurricular() <= 2) { throw new RuntimeException("Attempting to delete the a school class that is not inconsistent! ano = " + schoolClass.getAnoCurricular()); } schoolClass.delete(); schoolClass = FenixFramework.getDomainObject("2314987440497"); if (schoolClass.getAnoCurricular() <= 2) { throw new RuntimeException("Attempting to delete the a school class that is not inconsistent! ano = " + schoolClass.getAnoCurricular()); } schoolClass.delete(); schoolClass = FenixFramework.getDomainObject("2314987439896"); if (schoolClass.getAnoCurricular() <= 2) { throw new RuntimeException("Attempting to delete the a school class that is not inconsistent! ano = " + schoolClass.getAnoCurricular()); } schoolClass.delete(); } }