I want to know how things work inside Hibernate.
So, I have a person in DB whoes name is "Peter";
Session session = SessionFactory.openSession();
Person p = session.get(Person.class, 1);//Peter's id is 1
System.out.println(p.getName());//output : Peter
p.setName("Joey");
session.flush();
session.close();
And now this person's name in DB have changed to "Joey".
How did that happened?
when I changed the person's name. How did hibernate detected the changes?