if(oldDegree.getDegreeInfos() == null || oldDegree.getDegreeInfos().isEmpty()){ IDegreeInfo degreeInfo = new DegreeInfo(); degreeInfo.setDegree(oldDegree); degreeInfo.setLastModificationDate(new Timestamp(Calendar.getInstance().getTimeInMillis())); persistentSuport.getIPersistentDegreeInfo().simpleLockWrite(degreeInfo); }
    public void run(InfoDegree newInfoDegree) throws FenixServiceException {        ISuportePersistente persistentSuport = null;        ICursoPersistente persistentDegree = null;        IDegree oldDegree = null;        try {            persistentSuport = PersistenceSupportFactory.getDefaultPersistenceSupport();            persistentDegree = persistentSuport.getICursoPersistente();            oldDegree = persistentDegree.readByIdInternal(newInfoDegree.getIdInternal());            if (oldDegree == null) {                throw new NonExistingServiceException();            }            persistentDegree.simpleLockWrite(oldDegree);            oldDegree.setNome(newInfoDegree.getNome());            oldDegree.setSigla(newInfoDegree.getSigla());            oldDegree.setTipoCurso(newInfoDegree.getTipoCurso());        } catch (ExistingPersistentException ex) {            throw new ExistingServiceException(ex);        } catch (ExcepcaoPersistencia excepcaoPersistencia) {            throw new FenixServiceException(excepcaoPersistencia);        }    }