I am testing hibernate and giving this query to
transaction = session.beginTransaction(); city = new City(\"A\"); city = (City)session.merge(city); city.setNam
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.
city