Configuration cfg = new Configuration().configure();
SchemaExport se = new SchemaExport(cfg);
se.create(true, true);
SchemaExport構造函數已更改,create方法裡的參數也變了,最新的是如何操作的?
我已找到答案,如下:
ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder()
.configure()
.build();
MetadataImplementor metadata = (MetadataImplementor)
new MetadataSources(serviceRegistry)
.buildMetadata();
new SchemaExport().create( EnumSet.of(TargetType.DATABASE), metadata );