if(action.equals("check")) {
Query q = sessionDb.createQuery("from Client C");
List<Client> clients = q.list() ;
request.setAttribute("clients", clients);
Integer id = null;
try {
id = Integer.parseInt(request.getParameter("id"));
}
catch (NumberFormatException e) {
// TODO: handle exception
}
if(id != null) {
String hql="select C.nom,C.prenom,C.raison_sociale,C.nom_mededin,C.date_operation,C.date_accident,cc.objet from Client C,CommandeClient cc where C.id=cc.client.id and C.id="+id;
request.setAttribute("client",(Client)q1.list().get(0));
/* Query q1= sessionDb.createQuery(hql);
q1.list();*/
/*q = sessionDb.createQuery("from Client C where C.id =" + id);
Client client = (Client)q.uniqueResult() ;
request.setAttribute("client", client);*/
}
gotoPage("/jsp/clients/check.jsp", request, response);
Partager