final IExecutionPeriod executionPeriod = Cloner .copyInfoExecutionPeriod2IExecutionPeriod(oldClassView.getInfoExecutionPeriod());  final IExecutionDegree executionDegree = Cloner .copyInfoExecutionDegree2ExecutionDegree(oldClassView.getInfoExecutionDegree());  final ISchoolClass classToEdit = sp.getITurmaPersistente() .readByNameAndExecutionDegreeAndExecutionPeriod(oldClassView.getNome(), executionDegree.getIdInternal(), executionPeriod.getIdInternal());
final ISchoolClass classToEdit = (ISchoolClass) sp.getITurmaPersistente().readByOID( SchoolClass.class, oldClassView.getIdInternal()); final IExecutionPeriod executionPeriod = classToEdit.getExecutionPeriod(); final IExecutionDegree executionDegree = classToEdit.getExecutionDegree();
    public Object run(final InfoClass oldClassView, final InfoClass newClassView)            throws FenixServiceException, ExcepcaoPersistencia {        final ISuportePersistente sp = PersistenceSupportFactory.getDefaultPersistenceSupport();        final IExecutionPeriod executionPeriod = Cloner                .copyInfoExecutionPeriod2IExecutionPeriod(oldClassView.getInfoExecutionPeriod());        final IExecutionDegree executionDegree = Cloner                .copyInfoExecutionDegree2ExecutionDegree(oldClassView.getInfoExecutionDegree());        final ISchoolClass classToEdit = sp.getITurmaPersistente()                .readByNameAndExecutionDegreeAndExecutionPeriod(oldClassView.getNome(),                        executionDegree.getIdInternal(), executionPeriod.getIdInternal());        final ISchoolClass otherClassWithSameNewName = sp.getITurmaPersistente()                .readByNameAndExecutionDegreeAndExecutionPeriod(newClassView.getNome(),                        executionDegree.getIdInternal(), executionPeriod.getIdInternal());        if (otherClassWithSameNewName != null) {            throw new ExistingServiceException("Duplicate Entry: " + otherClassWithSameNewName.getNome());        }        sp.getITurmaPersistente().simpleLockWrite(classToEdit);        classToEdit.setNome(newClassView.getNome());        return new Boolean(true);    }