ITeye博客

利用hibernate的映射逆向生成数据库表

tianmo2008 · 2009-10-08 01:30 · hibernate学习笔记 · Java · XML · Hibernate · Markdown

用hibernate,除了可以根据数据库生成对应的po,也能逆向根据po生成对应的数据库表, 首先是要建好一个空数据库,接着给加一个属性 [code="xml"] create [/code] 再执行如下代码 [code="java"] //装载配置文件 Configuration cfg = new Configuration().configure(); SchemaExport export = new SchemaExport(cfg); export.create(true, true); [/code]

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。