首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

1 Configuration类 之 SchemaExport

2012-10-09 
一Configuration类 之 SchemaExportSchemaExport exportnew SchemaExport(cfg)export.create(true, true

一 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)进行处理。

热点排行