根据hibernate生成表
2012-01-04 15:06
92 查看
建一个main方法;
Configuration cfg = ( new Configuration()).configure(new File("src/hibernate.cfg.xml"));
SchemaExport export = new SchemaExport(cfg);
export.create(true, true);
执行就OK了;
执行之前要先建好数据库
导入的类
import java.io.File;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
Configuration cfg = ( new Configuration()).configure(new File("src/hibernate.cfg.xml"));
SchemaExport export = new SchemaExport(cfg);
export.create(true, true);
执行就OK了;
执行之前要先建好数据库
导入的类
import java.io.File;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
相关文章推荐
- hibernate 根据配置文件生成 mysql表
- hibernate 根据实体类自动生成表
- myeclipse 逆向工程生成根据数据表生成映射文件,javaBean,hibernate.cfg.xml
- Hibernate根据配置文件,生成建表语句
- 使用Hibernate-tools中的hbm2java和hbm2ddl根据hbm文件自动生成pojo和数据库脚本
- 【IntelliJ Idea】idea下hibernate反向生成工具,根据数据表生成实体
- hibernate根据表生成多个java文件的原因
- 使用Hibernate-tools中的hbm2java和hbm2ddl根据hbm文件自动生成pojo和数据库脚本
- 使用idea根据数据库表生成java model类,基于hibernate
- hibernate 自动生成数据库(根据hibernate配置文件)
- Hibernate根据配置文件生成表结构和创建表的脚本
- SSH项目中根据Hibernate的映射文件生成数据库表的方案:
- hibernate使用myeclise简化开发----根据数据库及表反向生成代码信息
- hibernate根据映射文件生成数据库对象
- hibernate根据配置文件生成数据库表
- SpringMVC学习系列-后记 结合SpringMVC和Hibernate-validator,根据后台验证规则自动生成前台的js验证代码
- Hibernate_根据配置文件反向生成表格
- 使用Hibernate-tools中的hbm2java和hbm2ddl根据hbm文件自动生成pojo和数据库脚本
- hibernate 根据数据库表反生成javaBean
- 使用 hibernate 根据映射文件生成数据库表