隨筆 - 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 閱讀(165) 評論(0)  編輯  收藏 所屬分類: hibernate
          主站蜘蛛池模板: 盐津县| 都安| 明水县| 贵阳市| 卓资县| 宜宾市| 龙江县| 莱芜市| 秀山| 咸阳市| 海南省| 桐柏县| 石河子市| 天峻县| 囊谦县| 凌云县| 宝坻区| 五家渠市| 石屏县| 利川市| 淮安市| 美姑县| 石城县| 华容县| 乌海市| 乐陵市| 呼图壁县| 牙克石市| 揭阳市| 青神县| 石屏县| 江达县| 道真| 宁海县| 溆浦县| 东台市| 龙南县| 治县。| 台前县| 涡阳县| 临江市|