1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
EntityManager em = this.emf.createEntityManager();
EntityTransaction t = em.getTransaction();
t.begin();
intervention i = em.find(intervention.class, id);
Query query = em.createQuery("SELECT COUNT(n) AS nombre, n.global FROM note AS n WHERE intervention="+id+" GROUP BY n.global");
@SuppressWarnings("unchecked")
List<note> listnote = query.getResultList();
t.commit();
request.setAttribute("note", listnote);
request.setAttribute("i", i);
RequestDispatcher rd = request.getRequestDispatcher("interventionPage.jsp");
rd.forward(request, response); |