oqlQuery2 += " where turno.nome = $1 and turno.disciplinaExecucao.sigla = $2 " + "and  turno.disciplinaExecucao.executionPeriod.name = $3  " + "and  turno.disciplinaExecucao.executionPeriod.executionYear.year = $4  ";
oqlQuery2 += " where shift.idInternal = $1";
	public void delete(ITurno turno) throws ExcepcaoPersistencia {		try {			ITurnoAula turnoAula = null;			TurnoAulaOJB turnoAulaOJB = new TurnoAulaOJB();			String oqlQuery = "select all from " + TurnoAula.class.getName();			oqlQuery				+= " where turno.nome = $1 and turno.disciplinaExecucao.sigla = $2 "				+ "and  turno.disciplinaExecucao.executionPeriod.name = $3  "				+ "and  turno.disciplinaExecucao.executionPeriod.executionYear.year = $4  ";			query.create(oqlQuery);			query.bind(turno.getNome());			query.bind(turno.getDisciplinaExecucao().getSigla());			query.bind(				turno.getDisciplinaExecucao().getExecutionPeriod().getName());			query.bind(				turno					.getDisciplinaExecucao()					.getExecutionPeriod()					.getExecutionYear()					.getYear());			List result = (List) query.execute();			lockRead(result);			Iterator iterador = result.iterator();			while (iterador.hasNext()) {				turnoAula = (ITurnoAula) iterador.next();				turnoAulaOJB.delete(turnoAula);			}		} catch (QueryException ex) {			throw new ExcepcaoPersistencia(ExcepcaoPersistencia.QUERY, ex);		}		try {			ITurmaTurno turmaTurno = null;			TurmaTurnoOJB turmaTurnoOJB = new TurmaTurnoOJB();			String oqlQuery1 = "select all from " + TurmaTurno.class.getName();			oqlQuery1				+= " where turno.nome = $1 and turno.disciplinaExecucao.sigla = $2 "				+ "and  turno.disciplinaExecucao.executionPeriod.name = $3  "				+ "and  turno.disciplinaExecucao.executionPeriod.executionYear.year = $4  ";			query.create(oqlQuery1);			query.bind(turno.getNome());			query.bind(turno.getDisciplinaExecucao().getSigla());			query.bind(				turno.getDisciplinaExecucao().getExecutionPeriod().getName());			query.bind(				turno					.getDisciplinaExecucao()					.getExecutionPeriod()					.getExecutionYear()					.getYear());			List result = (List) query.execute();			lockRead(result);			Iterator iterador = result.iterator();			while (iterador.hasNext()) {				turmaTurno = (ITurmaTurno) iterador.next();				turmaTurnoOJB.delete(turmaTurno);			}		} catch (QueryException ex) {			throw new ExcepcaoPersistencia(ExcepcaoPersistencia.QUERY, ex);		}		try {			ITurnoAluno turnoAluno = null;			TurnoAlunoOJB turnoAlunoOJB = new TurnoAlunoOJB();			String oqlQuery2 = "select all from " + ShiftStudent.class.getName();			oqlQuery2				+= " where turno.nome = $1 and turno.disciplinaExecucao.sigla = $2 "				+ "and  turno.disciplinaExecucao.executionPeriod.name = $3  "				+ "and  turno.disciplinaExecucao.executionPeriod.executionYear.year = $4  ";			query.create(oqlQuery2);			query.bind(turno.getNome());			query.bind(turno.getDisciplinaExecucao().getSigla());			query.bind(				turno.getDisciplinaExecucao().getExecutionPeriod().getName());			query.bind(				turno					.getDisciplinaExecucao()					.getExecutionPeriod()					.getExecutionYear()					.getYear());			List result = (List) query.execute();			lockRead(result);			Iterator iterador = result.iterator();			while (iterador.hasNext()) {				turnoAluno = (ITurnoAluno) iterador.next();				turnoAlunoOJB.delete(turnoAluno);			}		} catch (QueryException ex) {			throw new ExcepcaoPersistencia(ExcepcaoPersistencia.QUERY, ex);		}		//				//		ITurno turnoCriteria = new Turno();		//				//		turnoCriteria.setNome(turno.getNome());		//		turnoCriteria.setDisciplinaExecucao(turno.getDisciplinaExecucao());		//				//		ITurmaTurno turmaTurno = new TurmaTurno(); 		//		turmaTurno.setTurno(turnoCriteria);		//		//		ITurnoAula turnoAula = new TurnoAula();		//		turnoAula.setTurno(turnoCriteria);		super.delete(turno);		//		deleteByCriteria(turmaTurno);		//		deleteByCriteria(turnoAula);		/*		TurmaTurnoOJB turmaTurnoOJB = new TurmaTurnoOJB();		TurnoAulaOJB turnoAulaOJB = new TurnoAulaOJB();				turmaTurnoOJB.delete(turmaTurno);		turnoAulaOJB.delete(turnoAula);		*/	}