Hibernate merge

后端 未结 3 1516
孤城傲影
孤城傲影 2021-02-04 12:35

I am testing hibernate and giving this query to

transaction = session.beginTransaction();
city = new City(\"A\");
city  = (City)session.merge(city);
city.setNam         


        
3条回答
  •  囚心锁ツ
    2021-02-04 13:07

    Because session is not closed yet and in persistence terms city object is still attached to session. So, any changes in that object will be listened by hibernate session and appropriate dml statement will be invoked.

提交回复
热议问题