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

          常用鏈接

          留言簿(2)

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

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

          首先建好POJO object, XML Mapping File(也可以使用工具根據(jù)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
          主站蜘蛛池模板: 广汉市| 山丹县| 岑巩县| 荥阳市| 四子王旗| 弥勒县| 襄垣县| 高州市| 长武县| 腾冲县| 安国市| 图们市| 金门县| 堆龙德庆县| 调兵山市| 普兰店市| 延庆县| 和硕县| 类乌齐县| 喜德县| 阳春市| 普兰店市| 彩票| 施甸县| 平邑县| 青州市| 左权县| 石棉县| 利川市| 唐海县| 夏津县| 栾城县| 白朗县| 丰台区| 新干县| 济南市| 汉川市| 遵义县| 蒙自县| 从江县| 宝鸡市|