try { ISuportePersistente sp = SuportePersistenteOJB.getInstance();  ITurma schoolClass = (ITurma) sp.getITurmaPersistente().readByOID(Turma.class, infoClass.getIdInternal()); sp.getITurmaPersistente().simpleLockWrite(schoolClass);  for (int i = 0; i < shiftOIDs.size(); i++) { ITurno shift = (ITurno) sp.getITurnoPersistente().readByOID(Turno.class, (Integer) shiftOIDs.get(i));  ITurmaTurno classShift = sp.getITurmaTurnoPersistente().readByTurmaAndTurno(schoolClass, shift); if (classShift != null) { sp.getITurmaTurnoPersistente().delete(classShift); }  schoolClass.getAssociatedShifts().remove(shift);  sp.getITurmaTurnoPersistente().simpleLockWrite(shift); shift.getAssociatedClasses().remove(schoolClass); }  result = true; } catch (ExcepcaoPersistencia ex) { throw new FenixServiceException(ex.getMessage()); }  return new Boolean(result);
return new Boolean(true);
    public Boolean run(InfoClass infoClass, List shiftOIDs) throws FenixServiceException {        boolean result = false;        try {            ISuportePersistente sp = SuportePersistenteOJB.getInstance();            ITurma schoolClass = (ITurma) sp.getITurmaPersistente().readByOID(Turma.class,                    infoClass.getIdInternal());            sp.getITurmaPersistente().simpleLockWrite(schoolClass);            for (int i = 0; i < shiftOIDs.size(); i++) {                ITurno shift = (ITurno) sp.getITurnoPersistente().readByOID(Turno.class,                        (Integer) shiftOIDs.get(i));                ITurmaTurno classShift = sp.getITurmaTurnoPersistente().readByTurmaAndTurno(schoolClass,                        shift);                if (classShift != null) {                    sp.getITurmaTurnoPersistente().delete(classShift);                }                schoolClass.getAssociatedShifts().remove(shift);                sp.getITurmaTurnoPersistente().simpleLockWrite(shift);                shift.getAssociatedClasses().remove(schoolClass);            }            result = true;        } catch (ExcepcaoPersistencia ex) {            throw new FenixServiceException(ex.getMessage());        }        return new Boolean(result);    }