Что произойдет в выводе, если я поменяю местами, мне не понятно Следующие изменения в выводе произойдут. Если я не поменяю местами
//Hibernate: insert into Person (age, name) values (?, ?)
//Hibernate: insert into Address (city, house, person_personId) values
//(?, ?, ?)
SessionFactory sessionFactory = new
Configuration().configure().buildSessionFactory();
Session session = sessionFactory.openSession();
session.beginTransaction();
// one to one---test
//What if we swap line 28 and 29
session.save(person);
session.save(address);
session.getTransaction().commit();
session.close();
and here is the output when i swap:
//Hibernate: insert into Address (city, house, person_personId)
//values (?, ?, ?)
//Hibernate: insert into Person (age, name) values (?, ?)
//Hibernate: update Address set city=?, house=?, person_personId=?
//where addressId=?