use of org.hibernate.tool.hbm2ddl.SchemaValidator in project hibernate-orm by hibernate.
the class ViewValidationTest method testSynonymUsingIndividuallySchemaValidator.
@Test
public void testSynonymUsingIndividuallySchemaValidator() {
ssr = new StandardServiceRegistryBuilder().applySetting(AvailableSettings.ENABLE_SYNONYMS, "true").applySetting(AvailableSettings.HBM2DDL_JDBC_METADATA_EXTRACTOR_STRATEGY, JdbcMetadaAccessStrategy.INDIVIDUALLY).build();
try {
final MetadataSources metadataSources = new MetadataSources(ssr);
metadataSources.addAnnotatedClass(TestEntityWithSynonym.class);
metadataSources.addAnnotatedClass(TestEntity.class);
new SchemaValidator().validate(metadataSources.buildMetadata());
} finally {
StandardServiceRegistryBuilder.destroy(ssr);
}
}
use of org.hibernate.tool.hbm2ddl.SchemaValidator in project hibernate-orm by hibernate.
the class ViewValidationTest method testSynonymUsingGroupedSchemaValidator.
@Test
public void testSynonymUsingGroupedSchemaValidator() {
ssr = new StandardServiceRegistryBuilder().applySetting(AvailableSettings.ENABLE_SYNONYMS, "true").applySetting(AvailableSettings.HBM2DDL_JDBC_METADATA_EXTRACTOR_STRATEGY, JdbcMetadaAccessStrategy.GROUPED).build();
try {
final MetadataSources metadataSources = new MetadataSources(ssr);
metadataSources.addAnnotatedClass(TestEntityWithSynonym.class);
metadataSources.addAnnotatedClass(TestEntity.class);
new SchemaValidator().validate(metadataSources.buildMetadata());
} finally {
StandardServiceRegistryBuilder.destroy(ssr);
}
}
Aggregations