try { String oqlQuery = "select professorship from " + Professorship.class.getName() + " where executionCourse.sigla = $1" + " and executionCourse.executionPeriod.name = $2" + " 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);  return result; } catch (QueryException ex) { throw new ExcepcaoPersistencia(ExcepcaoPersistencia.QUERY, ex); }
Criteria crit = new Criteria(); crit.addEqualTo("executionCourse.idInternal",executionCourse.getIdInternal()); return queryList(Professorship.class,crit);
	public List readByExecutionCourse(IDisciplinaExecucao executionCourse) throws ExcepcaoPersistencia {		try {			String oqlQuery =				"select professorship from "					+ Professorship.class.getName()					+ " where executionCourse.sigla = $1"					+ " and executionCourse.executionPeriod.name = $2"					+ " 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);			return result;		} catch (QueryException ex) {			throw new ExcepcaoPersistencia(ExcepcaoPersistencia.QUERY, ex);		}	}