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

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 17:27   2828   0

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("***************导出操作已经成功执行完毕******************");
}

}

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP