hibernate工作原理:
通过Configuration config = new Configuration().configure();//读取并解析hibernate.cfg.xml配置文件
由hibernate.cfg.xml中的读取并解析映射信息
通过SessionFactory sf = config.buildSessionFactory();//创建SessionFactory
Session session = sf.openSession();//打开Sesssion
Transaction tx = session.beginTransaction();//创建并启动事务Transation
persistent operate操作数据,持久化操作
tx.commit();//提交事务
关闭Session
关闭SesstionFactory