Hibernate5.x 使用SchemaExport生成数据表
来源:互联网 发布:软件安装app 编辑:程序博客网 时间:2024/04/28 20:34
在学习使用Hibernate生成数据表时,发现Hibernate4.x中的configuration已失效,新语法如下
`import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.boot.spi.MetadataImplementor;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.junit.Test;
public class TestStudents {
@Testpublic void tsetSchemaExport(){ ServiceRegistry serviceRegistry = newStandardServiceRegistryBuilder().configure().build(); MetadataImplementor metadata = (MetadataImplementor) new MetadataSources( serviceRegistry ).buildMetadata(); new SchemaExport(metadata).create(true, true); }
}`
0 0
- Hibernate5.x 使用SchemaExport生成数据表
- 使用SchemaExport生成数据表
- hibernate使用SchemaExport自动生成数据表
- SchemaExport 类使用(自动生成数据表)
- Hibernate(一)——使用SchemaExport生成数据表
- Hibernate ORM入门02-使用SchemaExport生成数据表
- Hibernate5.2.10使用SchemaExport创建数据库
- 利用hibernate中的SchemaExport生成数据表
- 利用hibernate中的SchemaExport生成数据表
- 一口一口吃掉Hibernate(一)——使用SchemaExport生成数据表
- 使用SchemaExport生成数据库表
- 系统学习hibernate之一:利用hibernate中的SchemaExport生成数据表
- 系统学习hibernate之一:利用hibernate中的SchemaExport生成数据表
- 系统学习hibernate之一:利用hibernate中的SchemaExport生成数据表
- Hibernate初学者---schemaExport自动生成联合主键关联数据表
- 使用schemaExport自动生成表结构
- Hibernate 使用SchemaExport自动生成表
- Hibernate5.2.6使用schemaExport报错以及创建表后数据库中不显示
- Python类中方法的self参数
- 单调队列
- jQuery复选框-全选、全不选
- 最完整的Oracle11g 概述
- oracle11g 手动卸载方法
- Hibernate5.x 使用SchemaExport生成数据表
- 11-分类的线性模型
- Android开发之实现RecyclerView万能适配器
- C#基础知识(十)——对象引用
- 高斯消元初步
- LTE资源调度(4)-上行资源申请方式和BSR缓存状态报告
- 【树2】树的子结构
- HDU 2050 折线分割平面
- 【GDOI2017模拟8.11】生物学家