} else oqlQuery += " where name = $1 and keySuperiorSection = $2";
} else {   oqlQuery += " and superiorSection.name = $2"; oqlQuery += " and superiorSection.site.executionCourse.nome = $3"; oqlQuery += " and superiorSection.site.executionCourse.executionPeriod.name = $4"; oqlQuery += " and superiorSection.site.executionCourse.executionPeriod.executionYear.year = $5";}
    public ISection readBySiteAndSectionAndName(ISite site, ISection superiorSection, String name) throws ExcepcaoPersistencia {        try {            ISection resultSection = null;            Section section = (Section) superiorSection;            String oqlQuery = "select section from " + Section.class.getName();            if (section == null){				oqlQuery += " where name = $1 and is_undefined(keySuperiorSection)";				oqlQuery += " and site.executionCourse.nome = $2";				oqlQuery += " and site.executionCourse.executionPeriod.name = $3";				oqlQuery += " and site.executionCourse.executionPeriod.executionYear.year = $4";            }                            else                oqlQuery += " where name = $1 and keySuperiorSection = $2";            query.create(oqlQuery);            query.bind(name);                        if (section == null){				query.bind(site.getExecutionCourse().getNome());				query.bind(site.getExecutionCourse().getExecutionPeriod().getName());				query.bind(site.getExecutionCourse().getExecutionPeriod().getExecutionYear().getYear());            }            else{                query.bind(section.getInternalCode());            }                        List result = (List) query.execute();            lockRead(result);            if (result.size() != 0)				resultSection = (ISection) result.get(0);            return resultSection;        } catch (QueryException queryEx) {            throw new ExcepcaoPersistencia(ExcepcaoPersistencia.QUERY, queryEx);        }    }