Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void updateGlumi(Glumac g, double honorar) {
- EntityManager em = PersistenceUtil.getEntityManager();
- EntityTransaction et = null;
- try{
- et = em.getTransaction();
- et.begin();
- em.flush();
- et.commit();
- }catch(Exception ex){
- ex.printStackTrace();
- if(et != null){
- et.rollback();
- }
- }finally{
- if(em != null){
- em.close();
- }
- }
- }
- public List<Film> filmoviGlumca(Glumac g) {
- //moze i id
- EntityManager em = PersistenceUtil.getEntityManager();
- Query q = em.createQuery("from Film f join fetch f.glumis gl where gl.glumac=:g");
- q.setParameter("g",g);
- return q.getResultList();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement