reset password
Author Message
jbaber
Posts: 14
Posted 19:53 Feb 12, 2015 |

Hi,

I am trying to update the current Plan of a department but no changes are taking place in that field. I have tried every possible combination (merge, createQuery). No errors either. What am I missing?

@Transactional

@Override

    public  void officialPlan(Integer plan_id){

        Plan plan = entityManager.find( Plan.class, plan_id );

        Department department = plan.getDepartment();

        department.setCurrentPlan(plan);

        entityManager.getTransaction().begin();

        entityManager.persist( department );

        entityManager.getTransaction().commit();

        entityManager.close();

    }

Thank you

Last edited by jbaber at 19:54 Feb 12, 2015.
afetiso
Posts: 84
Posted 21:39 Feb 12, 2015 |

Are you found an error?

jbaber
Posts: 14
Posted 23:50 Feb 12, 2015 |

Nope.