bonjour,
je voulais que le champ tot_d (total débit) de ma table info_arrete prend comme valeur la somme des montant de la table operation, et voilà le code que j'ai écrit ,
je n'aarive pas à localiser le problème qui cause l'exception;
je veux ajouter que j'ai tester la requête sur oracle et elle donne le resultat
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 public void Opinfo() { EntityManager em = getEntityManager(); try { Query q = em.createQuery("select sum(o.montant) from Operation o,Transaction t,Caisse c where (o.cod_caisse=c.code_caisse)and(t.sens='C')and(o.cod_transac=t.code)"); infoArrete.setTotD((BigInteger) q.getSingleResult()) ; } finally { em.close(); } } public String create() { EntityManager em = getEntityManager(); try { utx.begin(); //appel de la procedure Opinfo() Opinfo(); utx.persist(); utx.commit(); } catch (Exception ex) { try { if (findInfoArrete(infoArrete.getCodeInfo()) != null) { addErrorMessage("InfoArrete " + infoArrete + " existe déjà"); } else { ensureAddErrorMessage(ex, "A persistence error occurred."); } utx.rollback(); } catch (Exception e) { ensureAddErrorMessage(e, "An error occurred attempting to roll back the transaction."); } return null; } finally { em.close(); } return listSetup(); }
j'espère que quelqu'un pourra m'aider
merci
Partager