Configuration的作用
1.Hibernate通过该对象加载配置文件,读取配置文件中的信息,启动Hibernate
2.可以创建SessionFactory对象
- eg:
// 先加载配置文件
Configuration config = new Configuration();
// 默认加载src目录下的配置文件
config.configure();
// 创建SessionFactory对象
SessionFactory factory = config.buildSessionFactory();