Lesson lesson = (Lesson) queryObject(Lesson.class, crit);
ILesson lesson = (ILesson) queryObject(Lesson.class, crit);
    public List readByRoomAndExecutionPeriod(final Integer roomOID, final Integer executionPeriodOID)            throws ExcepcaoPersistencia {        Criteria crit = new Criteria();        crit.addEqualTo("keyRoom", roomOID);        List roomsOccupation = queryList(RoomOccupation.class, crit);        ArrayList lessonList = new ArrayList();        for (int i = 0; i < roomsOccupation.size(); i++) {            crit = new Criteria();            IRoomOccupation roomOccupation = (IRoomOccupation) roomsOccupation.get(i);            crit.addEqualTo("keyRoomOccupation", roomOccupation.getIdInternal());            crit.addEqualTo("keyExecutionPeriod", executionPeriodOID);            Lesson lesson = (Lesson) queryObject(Lesson.class, crit);            if (lesson != null) {                lessonList.add(lesson);            }        }        return lessonList;    }