use of org.dbflute.exception.DfRequiredPropertyNotFoundException in project dbflute-core by dbflute.
the class TorqueDocumentationTask method throwSchemaSyncCheckPropertyNotFoundException.
protected void throwSchemaSyncCheckPropertyNotFoundException() {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found the property for SchemaSyncCheck.");
br.addItem("Advice");
br.addElement("You should set the property like this:");
br.addElement("[documentDefinitionMap.dfprop]");
br.addElement(" ; schemaSyncCheckMap = map:{");
br.addElement(" ; url = jdbc:...");
br.addElement(" ; schema = EXAMPLEDB");
br.addElement(" ; user = exampuser");
br.addElement(" ; password = exampword");
br.addElement(" }");
final String msg = br.buildExceptionMessage();
throw new DfRequiredPropertyNotFoundException(msg);
}
use of org.dbflute.exception.DfRequiredPropertyNotFoundException in project dbflute-core by dbflute.
the class TorqueDocumentationTask method throwLoadDataReversePropertyNotFoundException.
protected void throwLoadDataReversePropertyNotFoundException() {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found the property for LoadDataReverse.");
br.addItem("Advice");
br.addElement("You should set the property like this:");
br.addElement("[documentDefinitionMap.dfprop]");
br.addElement(" ; loadDataReverseMap = map:{");
br.addElement(" ; recordLimit = -1");
br.addElement(" ; isReplaceSchemaDirectUse = true");
br.addElement(" ; isOverrideExistingDataFile = false");
br.addElement(" }");
final String msg = br.buildExceptionMessage();
throw new DfRequiredPropertyNotFoundException(msg);
}
use of org.dbflute.exception.DfRequiredPropertyNotFoundException in project dbflute-core by dbflute.
the class DfReplaceSchemaProperties method getAdditionalDropSchema.
public UnifiedSchema getAdditionalDropSchema(Map<String, Object> additionalDropMap) {
final String url = getAdditionalDropUrl(additionalDropMap);
final String catalog;
if (Srl.is_NotNull_and_NotTrimmedEmpty(url)) {
final DfUrlAnalyzerFactory factory = new DfUrlAnalyzerFactory(getBasicProperties(), url);
final DfUrlAnalyzer analyzer = factory.createAnalyzer();
catalog = analyzer.extractCatalog();
} else {
catalog = getDatabaseProperties().getDatabaseCatalog();
}
final Object obj = additionalDropMap.get("schema");
if (obj == null) {
if (!isDatabaseAsSchemaSpecificationOmittable()) {
String msg = "The schema is required:";
msg = msg + " additionalDropMap=" + additionalDropMap;
throw new DfRequiredPropertyNotFoundException(msg);
}
return null;
}
final String schema = castToString(obj, "additionalDropMapList.schema");
final UnifiedSchema unifiedSchema = UnifiedSchema.createAsDynamicSchema(catalog, schema);
return unifiedSchema;
}
use of org.dbflute.exception.DfRequiredPropertyNotFoundException in project dbflute-core by dbflute.
the class DfDatabaseProperties method getAdditionalSchemaMap.
protected Map<String, DfAdditionalSchemaInfo> getAdditionalSchemaMap() {
if (_additionalSchemaMap != null) {
return _additionalSchemaMap;
}
assertOldStyleAdditionalSchema();
_additionalSchemaMap = StringKeyMap.createAsCaseInsensitive();
final Map<String, Object> additionalSchemaMap = getVairousStringKeyMap("additionalSchemaMap");
if (additionalSchemaMap.isEmpty()) {
return _additionalSchemaMap;
}
final Set<Entry<String, Object>> entrySet = additionalSchemaMap.entrySet();
for (Entry<String, Object> entry : entrySet) {
final String identifiedSchema = entry.getKey();
final Object obj = entry.getValue();
if (obj == null) {
String msg = "The value of schema in the property 'additionalSchemaMap' should be required:";
msg = msg + " identifiedSchema=" + identifiedSchema;
msg = msg + " additionalSchemaMap=" + additionalSchemaMap;
throw new DfRequiredPropertyNotFoundException(msg);
}
if (!(obj instanceof Map<?, ?>)) {
String msg = "The type of schema value in the property 'additionalSchemaMap' should be Map:";
msg = msg + " type=" + DfTypeUtil.toClassTitle(obj) + " value=" + obj;
throw new DfIllegalPropertyTypeException(msg);
}
@SuppressWarnings("unchecked") final Map<String, Object> elementMap = (Map<String, Object>) obj;
final DfAdditionalSchemaInfo info = new DfAdditionalSchemaInfo();
final String catalog;
final boolean explicitCatalog;
if (identifiedSchema.contains(".")) {
catalog = Srl.substringFirstFront(identifiedSchema, ".");
explicitCatalog = true;
} else {
// as main catalog
catalog = getDatabaseCatalog();
explicitCatalog = false;
}
final String schema = filterDatabaseSchema(Srl.substringFirstRear(identifiedSchema, "."));
final UnifiedSchema unifiedSchema = createAsAdditionalSchema(catalog, schema, explicitCatalog);
info.setUnifiedSchema(unifiedSchema);
setupAdditionalSchemaObjectTypeTargetList(info, elementMap);
setupAdditionalSchemaTableExceptList(info, elementMap);
setupAdditionalSchemaTableTargetList(info, elementMap);
setupAdditionalSchemaColumnExceptList(info, elementMap);
info.setSuppressCommonColumn(isProperty("isSuppressCommonColumn", false, elementMap));
info.setSuppressProcedure(isProperty("isSuppressProcedure", false, elementMap));
_additionalSchemaMap.put(unifiedSchema.getIdentifiedSchema(), info);
}
return _additionalSchemaMap;
}
use of org.dbflute.exception.DfRequiredPropertyNotFoundException in project dbflute-core by dbflute.
the class DfBasicProperties method throwBasicInfoDatabaseNotFoundException.
protected void throwBasicInfoDatabaseNotFoundException(String returnedValue) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found the property 'database' in basicInfoMap.dfprop.");
br.addItem("Returned Value");
br.addElement(returnedValue);
br.addItem("Map");
final Map<String, Object> basicInfoMap = getBasicInfoMap();
for (Entry<String, Object> entry : basicInfoMap.entrySet()) {
br.addElement(entry.getKey() + " = " + entry.getValue());
}
final String msg = br.buildExceptionMessage();
throw new DfRequiredPropertyNotFoundException(msg);
}
Aggregations