您的位置:首页 > 其它

利用Hibernate对象配置信息自动导出生成表结构

2013-03-26 17:57 429 查看
package cn.com.justin.hibernate;

import org.hibernate.cfg.Configuration;

import org.hibernate.tool.hbm2ddl.SchemaExport;

/**

* 执行导出操作,hibernate将根据实体映射信息自动生成表结构

* @author Justin Hu

*

*/

public class ExportDbUsingHibernate {

public static void main(String[] args) {

Configuration configuration=new Configuration().configure();

SchemaExport schemaExport=new SchemaExport(configuration);

schemaExport.create(true, true);

System.out.println("***************导出操作已经成功执行完毕******************");

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: