摘要:
使一个游离对象转变为持久化对象。例如以下代码在session1中保存了一个Customer对象,然后在session2中更新这个Customer对象:Customer customer = new Customer();customer.setName("Tom");Session session1 = sessionFactory.buildSession();Transaction tx1 = session.beginTransaction();session1.save(customer);tx1.commit();session1.close();Session 阅读全文