use of org.dbflute.properties.DfSchemaPolicyProperties in project dbflute-core by dbflute.
the class TorqueDocumentationTask method processSchemaPolicyCheck.
// -----------------------------------------------------
// SchemaPolicyCheck
// -----------------
protected void processSchemaPolicyCheck() {
if (_schemaData == null) {
throw new IllegalStateException("SchemaPolicyCheck should be before making SchemaHTML because of schema data.");
}
final DfSchemaPolicyProperties prop = getSchemaPolicyCheckProperties();
final DfSPolicyChecker checker = prop.createChecker(() -> _schemaData.getDatabase().getTableList());
checker.checkPolicyIfNeeds();
}
use of org.dbflute.properties.DfSchemaPolicyProperties in project dbflute-core by dbflute.
the class DfSPolicyInRepsChecker method checkSchemaPolicyInRepsIfNeeds.
// ===================================================================================
// Check
// =====
public void checkSchemaPolicyInRepsIfNeeds() {
final DfReplaceSchemaProperties repsProp = getReplaceSchemaProperties();
if (!repsProp.isCheckSchemaPolicyInReps()) {
return;
}
final DfSchemaPolicyProperties policyProp = getSchemaPolicyProperties();
if (!policyProp.hasPolicy()) {
return;
}
_log.info("...Beginning schema policy check in replace-schema");
final String schemaXml = repsProp.getSchemaPolicyInRepsSchemaXml();
deleteTemporarySchemaXmlIfExists(schemaXml);
final DfSchemaXmlSerializer serializer = createSchemaXmlSerializer(schemaXml);
serializer.serialize();
try {
final DfSchemaXmlReader reader = createSchemaXmlReader(schemaXml);
final AppData appData = reader.read();
final Database database = appData.getDatabase();
// for "then classification"
initializeClassificationDeployment(database);
final List<Table> tableList = database.getTableList();
final DfSPolicyChecker checker = policyProp.createChecker(() -> tableList);
checker.checkPolicyIfNeeds();
} finally {
deleteTemporarySchemaXmlIfExists(schemaXml);
}
}
Aggregations