try { ISite site = null;  String oqlQuery = "select site from " + Site.class.getName(); oqlQuery += " where executionCourse.sigla = $1"; oqlQuery += " and executionCourse.executionPeriod.name = $2"; oqlQuery += " and executionCourse.executionPeriod.executionYear.year = $3"; query.create(oqlQuery); query.bind(executionCourse.getSigla()); query.bind(executionCourse.getExecutionPeriod().getName()); query.bind(executionCourse.getExecutionPeriod().getExecutionYear().getYear()); List result = (List) query.execute(); lockRead(result); if (result.size() != 0) site = (ISite) result.get(0); return site; } catch (QueryException ex) { throw new ExcepcaoPersistencia(ExcepcaoPersistencia.QUERY, ex); }
Criteria crit = new Criteria(); crit.addEqualTo("keyExecutionCourse", executionCourse.getIdInternal()); return (ISite) queryObject(Site.class, crit);
	public ISite readByExecutionCourse(IDisciplinaExecucao executionCourse) throws ExcepcaoPersistencia {		try {			ISite site = null;						String oqlQuery = "select site from " + Site.class.getName();			oqlQuery += " where executionCourse.sigla = $1";			oqlQuery += " and executionCourse.executionPeriod.name = $2";			oqlQuery += " and executionCourse.executionPeriod.executionYear.year = $3";			query.create(oqlQuery);			query.bind(executionCourse.getSigla());			query.bind(executionCourse.getExecutionPeriod().getName());			query.bind(executionCourse.getExecutionPeriod().getExecutionYear().getYear());			List result = (List) query.execute();			lockRead(result);			if (result.size() != 0)				site = (ISite) result.get(0);			return site;		} catch (QueryException ex) {			throw new ExcepcaoPersistencia(ExcepcaoPersistencia.QUERY, ex);		}	}