use of org.hibernate.tool.hbm2ddl.SchemaExport in project hibernate-orm by hibernate.
the class SchemaExportWithIndexAndDefaultSchema method tearDown.
@After
public void tearDown() {
System.out.println("********* Starting SchemaExport (drop) for TEAR-DOWN *************************");
new SchemaExport().drop(EnumSet.of(TargetType.DATABASE, TargetType.STDOUT), metadata);
System.out.println("********* Completed SchemaExport (drop) for TEAR-DOWN *************************");
StandardServiceRegistryBuilder.destroy(serviceRegistry);
serviceRegistry = null;
}
use of org.hibernate.tool.hbm2ddl.SchemaExport in project hibernate-orm by hibernate.
the class SchemaMigrationTargetScriptCreationTest method tearDown.
@After
public void tearDown() {
ServiceRegistry serviceRegistry = ServiceRegistryBuilder.buildServiceRegistry(Environment.getProperties());
try {
MetadataImplementor metadata = (MetadataImplementor) new MetadataSources(serviceRegistry).addAnnotatedClass(TestEntity.class).buildMetadata();
metadata.validate();
new SchemaExport().drop(EnumSet.of(TargetType.DATABASE, TargetType.STDOUT), metadata);
} finally {
ServiceRegistryBuilder.destroy(serviceRegistry);
}
}
use of org.hibernate.tool.hbm2ddl.SchemaExport in project hibernate-orm by hibernate.
the class SchemaUpdateWithFunctionIndexTest method tearDown.
@After
public void tearDown() {
dropFunctionIndex();
dropTable();
new SchemaExport().drop(EnumSet.of(TargetType.DATABASE, TargetType.STDOUT), metadata);
StandardServiceRegistryBuilder.destroy(serviceRegistry);
}
use of org.hibernate.tool.hbm2ddl.SchemaExport in project hibernate-orm by hibernate.
the class SchemaUpdateWithViewsTest method tearDown.
@After
public void tearDown() {
dropView();
System.out.println("********* Starting SchemaExport (drop) for TEAR-DOWN *************************");
new SchemaExport().drop(EnumSet.of(TargetType.STDOUT, TargetType.DATABASE), metadata);
System.out.println("********* Completed SchemaExport (drop) for TEAR-DOWN *************************");
StandardServiceRegistryBuilder.destroy(serviceRegistry);
serviceRegistry = null;
}
use of org.hibernate.tool.hbm2ddl.SchemaExport in project hibernate-orm by hibernate.
the class SQLServer2008NVarCharTypeTest method createSchemaExport.
private SchemaExport createSchemaExport(Class[] annotatedClasses) {
final MetadataSources metadataSources = new MetadataSources(ssr);
for (Class c : annotatedClasses) {
metadataSources.addAnnotatedClass(c);
}
metadata = (MetadataImplementor) metadataSources.buildMetadata();
metadata.validate();
SchemaExport schemaExport = new SchemaExport();
schemaExport.setHaltOnError(true).setFormat(false);
return schemaExport;
}
Aggregations