一 Configuration类 之 SchemaExport
SchemaExport export=new SchemaExport(cfg);
export.create(true, true);
SchemaExport类是一个将表结构导入数据库的工具。
public SchemaExport(Configuration cfg) throws HibernateException {
this( cfg, cfg.getProperties() );
}
--->
public SchemaExport(Configuration cfg, Settings settings) throws HibernateException
从配置中得到方言dialect,根据方言得到相应生成表的SQL,和删除表的SQL。
创建一个应用程序到数据库的连接帮助类。
---> export.create(true, true);
直接跳转到 execute( true, true, false, false )
----> execute(boolean, boolean, boolean, boolean )
根据导入的SQL(import.sql)进行处理。