Hibernate 使用SchemaExport自动生成表
2017-11-06 16:15
211 查看
在Hibernate5.x版本中,SchemaExport构造方法发生变化。
之前的使用方法如下:
SchemaExport export = new SchemaExport(new Configuration().configure());export.create(true,true);
现在,自动生成表的用法如下:
ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().configure().build();Metadata metadata = new MetadataSources(serviceRegistry).buildMetadata();
SchemaExport schemaExport = new SchemaExport();
schemaExport.create(EnumSet.of(TargetType.DATABASE), metadata);
相关文章推荐
- hibernate使用SchemaExport自动生成数据表
- Hibernate5.x 使用SchemaExport生成数据表
- Hibernate(一)——使用SchemaExport生成数据表
- Hibernate使用SchemaExport和AnnotationConfiguration生成表结构
- 使用schemaExport自动生成表结构
- Hibernate之——使用SchemaExport类自动创建数据库表
- 一口一口吃掉Hibernate(一)——使用SchemaExport生成数据表
- Hibernate初学者---schemaExport自动生成联合主键关联数据表
- 一口一口吃掉Hibernate(一)——使用SchemaExport生成数据表
- 利用ant,hibernate的schemaexport自动生成数据库
- SchemaExport 类使用(自动生成数据表)
- 使用schemaExport自动生成表结构
- [Hibernate系列—] 3. 映射文件与使用SchemaExport自动产生Schema
- hibernate中使用schemaExport生成数据表报错解决方法
- Hibernate整合Spring后,如何使用SchemaExport生成数据库表
- [Hibernate系列—] 3. 映射文件与使用SchemaExport自动产生Schema
- hibernate使用SchemaExport生成对应的数据库表
- 【Hibernate】——SchemaExport自动生成数据库表
- 使用schemaExport自动生成表结构
- hibernate中使用schemaExport生成数据表报错解决方法