Rev 1457 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1457 | Rev 1471 | ||
---|---|---|---|
Line 109... | Line 109... | ||
109 | return (1.5.0/docs/api/java/lang/Long.html">Long)result; |
109 | return (1.5.0/docs/api/java/lang/Long.html">Long)result; |
110 | } |
110 | } |
111 | else |
111 | else |
112 | return 0; |
112 | return 0; |
113 | } |
113 | } |
- | 114 | public long getNumeroAlunosComRespostas(long questionarioId) |
|
- | 115 | { |
|
- | 116 | 1.5.0/docs/api/javax/management/Query.html">Query q = AbstractDao.getCurrentSession().createQuery("SELECT " + |
|
- | 117 | " count(distinct a.aluno.id) AS respostasAlunos " + |
|
- | 118 | "from " + QuestionarioPedagogicoCursoAfeto.class.getName() + " c " + |
|
- | 119 | "JOIN c.questionario q " + |
|
- | 120 | "JOIN c.unidadesAfetas u " + |
|
- | 121 | "JOIN u.tipologiasRequisitadas t " + |
|
- | 122 | "JOIN t.alunosRequisitados a " + |
|
- | 123 | "JOIN a.respostaRequisitada rR " + |
|
- | 124 | "JOIN rR.resposta r " + |
|
- | 125 | "WHERE q.id = :id "); |
|
- | 126 | ||
- | 127 | q.setLong("id",questionarioId); |
|
- | 128 | 5+0%2Fdocs%2Fapi+Object">Object result = q.uniqueResult(); |
|
- | 129 | if(result != null) |
|
- | 130 | return (1.5.0/docs/api/java/lang/Long.html">Long) result; |
|
- | 131 | return 0; |
|
- | 132 | } |
|
114 | public long getNumeroUnidadesUsadas(long questionarioId) |
133 | public long getNumeroUnidadesUsadas(long questionarioId) |
115 | { |
134 | { |
116 | 1.5.0/docs/api/javax/management/Query.html">Query q = getCurrentSession().createQuery |
135 | 1.5.0/docs/api/javax/management/Query.html">Query q = getCurrentSession().createQuery |
117 | ("select count(u.id) from u in class " + QuestionarioPedagogicoUnidadeCurricularAfeta.class.getName() + " " + |
136 | ("select count(u.id) from u in class " + QuestionarioPedagogicoUnidadeCurricularAfeta.class.getName() + " " + |
118 | " JOIN u.cursoAfeto c " + |
137 | " JOIN u.cursoAfeto c " + |
Line 283... | Line 302... | ||
283 | public long unidadesUsadas; |
302 | public long unidadesUsadas; |
284 | public long tipologiasUsadas; |
303 | public long tipologiasUsadas; |
285 | public long profsTimeStudents; |
304 | public long profsTimeStudents; |
286 | public long respostasRequisitadas; |
305 | public long respostasRequisitadas; |
287 | public long respostasObtidas; |
306 | public long respostasObtidas; |
- | 307 | public long alunosQueResponderam; |
|
288 | } |
308 | } |
289 | 309 | ||
290 | 310 | ||
291 | 311 | ||
292 | 312 | ||
Line 324... | Line 344... | ||
324 | questionarioStatsVars.alunos = (1.5.0/docs/api/java/lang/Long.html">Long) results[4]; |
344 | questionarioStatsVars.alunos = (1.5.0/docs/api/java/lang/Long.html">Long) results[4]; |
325 | questionarioStatsVars.alunosDeUsadas = (1.5.0/docs/api/java/lang/Long.html">Long) results[5]; |
345 | questionarioStatsVars.alunosDeUsadas = (1.5.0/docs/api/java/lang/Long.html">Long) results[5]; |
326 | questionarioStatsVars.profsDeUsadas = (1.5.0/docs/api/java/lang/Long.html">Long) results[6]; |
346 | questionarioStatsVars.profsDeUsadas = (1.5.0/docs/api/java/lang/Long.html">Long) results[6]; |
327 | questionarioStatsVars.tipologiasUsadas = (1.5.0/docs/api/java/lang/Long.html">Long) results[7]; |
347 | questionarioStatsVars.tipologiasUsadas = (1.5.0/docs/api/java/lang/Long.html">Long) results[7]; |
328 | questionarioStatsVars.profsTimeStudents = (1.5.0/docs/api/java/lang/Long.html">Long) results[8]; |
348 | questionarioStatsVars.profsTimeStudents = (1.5.0/docs/api/java/lang/Long.html">Long) results[8]; |
- | 349 | questionarioStatsVars.alunosQueResponderam = getNumeroAlunosComRespostas(questionarioId); |
|
329 | questionarioStatsVars.respostasRequisitadas = getNumeroRespostasRequisitadas(questionarioId); |
350 | questionarioStatsVars.respostasRequisitadas = getNumeroRespostasRequisitadas(questionarioId); |
330 | questionarioStatsVars.respostasObtidas = getNumeroRespostas(questionarioId); |
351 | questionarioStatsVars.respostasObtidas = getNumeroRespostas(questionarioId); |
331 | questionarioStatsVars.unidadesUsadas = getNumeroUnidadesUsadas(questionarioId); |
352 | questionarioStatsVars.unidadesUsadas = getNumeroUnidadesUsadas(questionarioId); |
332 | if(questionarioStatsVars.unidadesUsadas > questionarioStatsVars.unidades) |
353 | if(questionarioStatsVars.unidadesUsadas > questionarioStatsVars.unidades) |
333 | logger.error("TEM UM ERRO NA QUERY, a contagem de usadas com o distinct da diferente de com o SUM"); |
354 | logger.error("TEM UM ERRO NA QUERY, a contagem de usadas com o distinct da diferente de com o SUM"); |