Advertisement
Guest User

Untitled

a guest
May 28th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. public void updateGlumi(Glumac g, double honorar) {
  2. EntityManager em = PersistenceUtil.getEntityManager();
  3. EntityTransaction et = null;
  4. try{
  5. et = em.getTransaction();
  6. et.begin();
  7.  
  8.  
  9.  
  10. em.flush();
  11. et.commit();
  12. }catch(Exception ex){
  13. ex.printStackTrace();
  14. if(et != null){
  15. et.rollback();
  16. }
  17. }finally{
  18. if(em != null){
  19. em.close();
  20. }
  21. }
  22.  
  23. }
  24.  
  25. public List<Film> filmoviGlumca(Glumac g) {
  26.  
  27. //moze i id
  28. EntityManager em = PersistenceUtil.getEntityManager();
  29. Query q = em.createQuery("from Film f join fetch f.glumis gl where gl.glumac=:g");
  30. q.setParameter("g",g);
  31. return q.getResultList();
  32. }
  33.  
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement