隨筆 - 63  文章 - 0  trackbacks - 0
          <2009年4月>
          2930311234
          567891011
          12131415161718
          19202122232425
          262728293012
          3456789

          常用鏈接

          留言簿(2)

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          使用Hibernate自帶的工具hbm2ddl,建立根據你的對象建立數據庫:

          首先建好POJO object, XML Mapping File(也可以使用工具根據POJO class建立),配置文件(hibernate.cfg.xml)

          Java代碼


          import org.hibernate.cfg.Configuration;
          import org.hibernate.tool.hbm2ddl.SchemaExport;
          
          public class SchemaUtil {
          public static void main(String[] args) {

          Configuration cfg = new Configuration().configure(); SchemaExport schemaExport= new SchemaExport(cfg); schemaExport.create(false, true); } }
          posted on 2009-04-11 16:31 lanxin1020 閱讀(169) 評論(0)  編輯  收藏 所屬分類: hibernate
          主站蜘蛛池模板: 麻城市| 高邑县| 保靖县| 天镇县| 蛟河市| 海淀区| 茶陵县| 交城县| 通许县| 太和县| 商丘市| 于都县| 蕉岭县| 山东省| 民权县| 苍南县| 宣城市| 关岭| 通江县| 义马市| 仙桃市| 稷山县| 阜康市| 于都县| 融水| 青川县| 永和县| 博罗县| 文安县| 铜陵市| 罗定市| 安新县| 濮阳县| 双桥区| 思茅市| 盐池县| 林周县| 佛坪县| 青川县| 江川县| 雅江县|