use of org.hibernate.tool.hbm2ddl.SchemaValidator in project midpoint by Evolveum.
the class SchemaChecker method determineDataStructureCompliance.
private DataStructureCompliance determineDataStructureCompliance() {
Metadata metadata = MetadataExtractorIntegrator.getMetadata();
try {
new SchemaValidator().validate(metadata);
LOGGER.debug("DB schema is OK.");
return new DataStructureCompliance(DataStructureCompliance.State.COMPLIANT, null);
} catch (org.hibernate.tool.schema.spi.SchemaManagementException e) {
LOGGER.warn("Found a problem with DB schema: {}", e.getMessage());
LOGGER.debug("Exception", e);
return new DataStructureCompliance(areSomeTablesPresent(metadata) ? DataStructureCompliance.State.NOT_COMPLIANT : DataStructureCompliance.State.NO_TABLES, e);
}
}
Aggregations