10
I am testing hibernate and giving this query to
transaction = session.beginTransaction();
city = new City("A");
city = (City)session.merge(city);
city.setName("B");
transaction.commit();
And I am getting those queries in the command line:
Hibernate: insert into CITY (name) values (?)
Hibernate: update CITY set name=? where CITY_ID=?
I am using merge not save, so why hibernate is updating my object, It should not update. am it right? What is the mistake?