package pt.utl.ist.scripts.runOnce; import net.sourceforge.fenixedu.domain.Exam; import org.joda.time.YearMonthDay; import pt.ist.fenixframework.FenixFramework; import pt.utl.ist.scripts.commons.AtomicScript; public class ExamDateFixLEE1011DEle2Term extends AtomicScript { @Override protected void run() throws Exception { Exam mentallyChallengedExam = FenixFramework.getDomainObject("506806611204"); YearMonthDay tumor = mentallyChallengedExam.getDayDateYearMonthDay(); if (tumor == null) { System.out.println("Durp.."); YearMonthDay chemo = new YearMonthDay(2011, 6, 16); mentallyChallengedExam.setDayDateYearMonthDay(chemo); } System.out.println(mentallyChallengedExam.getDayDateYearMonthDay().toString("dd-MM-yyyy")); } public static void main(String[] args) { processWriteTransaction(new ExamDateFixLEE1011DEle2Term()); System.exit(0); } }