use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfSplittingDfpropHandler method throwDfPropDefinitionDuplicateDefinitionException.
protected void throwDfPropDefinitionDuplicateDefinitionException(String mapName, String elementName, String keyword) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Found the duplicate definition.");
br.addItem("Advice");
br.addElement("The element names should be unique.");
br.addElement("(in all split files if split)");
br.addElement("For example:");
br.addElement(" (x):");
br.addElement(" Sea = map:{");
br.addElement(" ; ...");
br.addElement(" }");
br.addElement(" Sea = map:{");
br.addElement(" ; ...");
br.addElement(" }");
br.addElement(" (o):");
br.addElement(" Land = map:{");
br.addElement(" ; ...");
br.addElement(" }");
br.addElement(" Sea = map:{");
br.addElement(" ; ...");
br.addElement(" }");
br.addItem("DBFlute Property");
br.addElement(mapName);
if (keyword != null) {
br.addItem("Duplicate Found Location");
br.addElement(keyword);
}
br.addItem("Duplicate Name");
br.addElement(elementName);
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg);
}
use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfRefClsRefTypeVerifier method doVerifyRefExists.
// -----------------------------------------------------
// Exists
// ------
protected void doVerifyRefExists(DfClassificationTop classificationTop) {
final List<DfClassificationElement> appElementList = classificationTop.getClassificationElementList();
final List<DfClassificationElement> referredElementList = _referredElementList;
final List<DfClassificationElement> nonExistingList = appElementList.stream().filter(appElement -> {
return notMatchesReferredElement(referredElementList, appElement);
}).collect(Collectors.toList());
if (!nonExistingList.isEmpty()) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found the app classification code in the referred classification");
br.addItem("Advice");
br.addElement("The codes of the app classification should be included");
br.addElement("in the referred classification because of refType='exists'.");
br.addElement("For example:");
br.addElement(" (x): app(A), referred(B, C)");
br.addElement(" (x): app(A, B), referred(A, C)");
br.addElement(" (x): app(A, B, C), referred(A, B)");
br.addElement(" (o): app(A), referred(A, B)");
br.addElement(" (o): app(A, B), referred(A, B, C)");
br.addElement(" (o): app(A, B, C), referred(A, B, C)");
br.addItem("dfprop File");
br.addElement(_resourceFile);
br.addItem("AppCls");
br.addElement(classificationTop.getClassificationName() + ": " + buildClsCodesExp(appElementList));
br.addItem("ReferredCls");
br.addElement(buildReferredExp() + ": " + buildClsCodesExp(referredElementList));
br.addItem("Ref Type");
br.addElement(_refType);
br.addItem("Non-Existing Code");
br.addElement(nonExistingList.stream().map(element -> {
return element.getCode();
}).collect(Collectors.joining(", ")));
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg);
}
}
use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfAbstractHelperProperties method throwClassificationSplitDefinitionNotFoundException.
protected void throwClassificationSplitDefinitionNotFoundException(String mapName, String keyword) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found the split definition of DBFlute property.");
br.addItem("Advice");
br.addElement("Make sure the file name of your split dfprop");
br.addElement("or define at least one definition in the split file.");
br.addElement("");
br.addElement("For example:");
br.addElement(" $$split$$ = map:{");
br.addElement(" ; land = dummy");
br.addElement(" ; sea = dummy");
br.addElement(" }");
br.addElement("");
br.addElement("The following files should exist:");
br.addElement(" dfprop/" + mapName + "_land.dfprop");
br.addElement(" dfprop/" + mapName + "_sea.dfprop");
br.addItem("DBFlute Property");
br.addElement(mapName);
br.addItem("Split Keyword");
br.addElement(keyword);
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg);
}
use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfClassificationProperties method throwClassificationAlreadyExistsInDfPropException.
protected void throwClassificationAlreadyExistsInDfPropException(String classificationName, String settingName) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("The classification already exists in dfprop settings.");
br.addItem("Advice");
br.addElement("Check the classification names in '" + settingName + "' settings.");
br.addElement("The settings may contain classifications existing in dfprop.");
br.addItem("Classification");
br.addElement(classificationName);
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg);
}
use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfAppClsTableLoader method findDBCls.
protected DfClassificationTop findDBCls(String classificationName, String refClsName, Map<String, DfClassificationTop> dbClsMap, DfFreeGenResource resource) {
final DfClassificationTop refTop = dbClsMap.get(refClsName);
if (refTop == null) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found the DB classification for app classification.");
br.addItem("Advice");
br.addElement("Make sure your DB classification name.");
br.addItem("AppCls");
br.addElement(classificationName);
br.addItem("NotFound DBCls");
br.addElement(refClsName);
br.addItem("Existing DBCls");
br.addElement(dbClsMap.keySet());
br.addItem("dfprop File");
br.addElement(resource.getResourceFile());
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg);
}
return refTop;
}
Aggregations