Search in sources :

Example 1 with DfFixedConditionInvalidClassificationEmbeddedCommentException

use of org.dbflute.exception.DfFixedConditionInvalidClassificationEmbeddedCommentException in project dbflute-core by dbflute.

the class ForeignKey method extractFixedConditionEmbeddedCommentClassification.

// -----------------------------------------------------
// EmbeddedComment Classification
// ------------------------------
protected String extractFixedConditionEmbeddedCommentClassification(String peace, String parameterType) {
    // parameterType is e.g. MemberStatus.Formalized
    if (!parameterType.contains(".")) {
        String msg = "The classification expression should be 'classificationName.elementName':";
        msg = msg + " expression=" + parameterType + " embeddedComment=" + peace;
        throw new DfFixedConditionInvalidClassificationEmbeddedCommentException(msg);
    }
    // e.g. MemberStatus
    final String classificationName = parameterType.substring(0, parameterType.indexOf("."));
    // e.g. Formalized
    final String elementName = parameterType.substring(parameterType.indexOf(".") + ".".length());
    final Map<String, DfClassificationTop> topMap = getClassificationProperties().getClassificationTopMap();
    final DfClassificationTop classificationTop = topMap.get(classificationName);
    if (classificationTop == null) {
        throwFixedConditionEmbeddedCommentClassificationNotFoundException(classificationName);
    }
    String code = doExtractFixedConditionEmbeddedCommentClassificationNormalCode(classificationTop, elementName);
    if (code != null) {
        return code;
    }
    // may be group here
    code = doExtractFixedConditionEmbeddedCommentClassificationGroupCode(classificationTop, elementName);
    if (code != null) {
        return code;
    }
    throwFixedConditionEmbeddedCommentClassificationElementNotFoundException(classificationTop, elementName);
    // unreachable
    return null;
}
Also used : DfFixedConditionInvalidClassificationEmbeddedCommentException(org.dbflute.exception.DfFixedConditionInvalidClassificationEmbeddedCommentException) DfClassificationTop(org.dbflute.properties.assistant.classification.DfClassificationTop)

Example 2 with DfFixedConditionInvalidClassificationEmbeddedCommentException

use of org.dbflute.exception.DfFixedConditionInvalidClassificationEmbeddedCommentException in project dbflute-core by dbflute.

the class DfFixedConditionDynamicAnalyzer method extractEmbeddedCommentClassification.

// ===================================================================================
// EmbeddedComment Classification
// ==============================
protected String extractEmbeddedCommentClassification(String peace, String parameterType) {
    // parameterType is e.g. MemberStatus.Formalized
    if (!parameterType.contains(".")) {
        String msg = "The classification expression should be 'classificationName.elementName':";
        msg = msg + " expression=" + parameterType + " embeddedComment=" + peace;
        throw new DfFixedConditionInvalidClassificationEmbeddedCommentException(msg);
    }
    // e.g. MemberStatus
    final String classificationName = parameterType.substring(0, parameterType.indexOf("."));
    // e.g. Formalized
    final String elementName = parameterType.substring(parameterType.indexOf(".") + ".".length());
    final Map<String, DfClassificationTop> topMap = getClassificationProperties().getClassificationTopMap();
    final DfClassificationTop classificationTop = topMap.get(classificationName);
    if (classificationTop == null) {
        throwFixedConditionEmbeddedCommentClassificationNotFoundException(classificationName);
    }
    String code = doExtractEmbeddedCommentClassificationNormalCode(classificationTop, elementName);
    if (code != null) {
        return code;
    }
    // may be group here
    code = doExtractEmbeddedCommentClassificationGroupCode(classificationTop, elementName);
    if (code != null) {
        return code;
    }
    throwFixedConditionEmbeddedCommentClassificationElementNotFoundException(classificationTop, elementName);
    // unreachable
    return null;
}
Also used : DfFixedConditionInvalidClassificationEmbeddedCommentException(org.dbflute.exception.DfFixedConditionInvalidClassificationEmbeddedCommentException) DfClassificationTop(org.dbflute.properties.assistant.classification.DfClassificationTop)

Example 3 with DfFixedConditionInvalidClassificationEmbeddedCommentException

use of org.dbflute.exception.DfFixedConditionInvalidClassificationEmbeddedCommentException in project dbflute-core by dbflute.

the class ForeignKey method throwFixedConditionEmbeddedCommentClassificationNotFoundException.

protected void throwFixedConditionEmbeddedCommentClassificationNotFoundException(String classificationName) {
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("Not found the classification in fixed condition.");
    br.addItem("Foreign Key");
    br.addElement(_name);
    br.addItem("NotFound Classification");
    br.addElement(classificationName);
    final String msg = br.buildExceptionMessage();
    throw new DfFixedConditionInvalidClassificationEmbeddedCommentException(msg);
}
Also used : ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfFixedConditionInvalidClassificationEmbeddedCommentException(org.dbflute.exception.DfFixedConditionInvalidClassificationEmbeddedCommentException)

Example 4 with DfFixedConditionInvalidClassificationEmbeddedCommentException

use of org.dbflute.exception.DfFixedConditionInvalidClassificationEmbeddedCommentException in project dbflute-core by dbflute.

the class ForeignKey method throwFixedConditionEmbeddedCommentClassificationElementNotFoundException.

protected void throwFixedConditionEmbeddedCommentClassificationElementNotFoundException(DfClassificationTop classificationTop, String elementName) {
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("Not found the classification element in fixed condition.");
    br.addItem("Foreign Key");
    br.addElement(_name);
    br.addItem("Classification Name");
    br.addElement(classificationTop.getClassificationName());
    br.addItem("NotFound Element");
    br.addElement(elementName);
    br.addItem("Defined Element");
    final List<DfClassificationElement> elementList = classificationTop.getClassificationElementList();
    for (DfClassificationElement element : elementList) {
        br.addElement(element);
    }
    final String msg = br.buildExceptionMessage();
    throw new DfFixedConditionInvalidClassificationEmbeddedCommentException(msg);
}
Also used : DfClassificationElement(org.dbflute.properties.assistant.classification.DfClassificationElement) ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfFixedConditionInvalidClassificationEmbeddedCommentException(org.dbflute.exception.DfFixedConditionInvalidClassificationEmbeddedCommentException)

Example 5 with DfFixedConditionInvalidClassificationEmbeddedCommentException

use of org.dbflute.exception.DfFixedConditionInvalidClassificationEmbeddedCommentException in project dbflute-core by dbflute.

the class DfFixedConditionDynamicAnalyzer method throwFixedConditionEmbeddedCommentClassificationNotFoundException.

protected void throwFixedConditionEmbeddedCommentClassificationNotFoundException(String classificationName) {
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("Not found the classification in fixed condition.");
    br.addItem("Foreign Key");
    br.addElement(_foreignKey.getName());
    br.addItem("NotFound Classification");
    br.addElement(classificationName);
    final String msg = br.buildExceptionMessage();
    throw new DfFixedConditionInvalidClassificationEmbeddedCommentException(msg);
}
Also used : ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfFixedConditionInvalidClassificationEmbeddedCommentException(org.dbflute.exception.DfFixedConditionInvalidClassificationEmbeddedCommentException)

Aggregations

DfFixedConditionInvalidClassificationEmbeddedCommentException (org.dbflute.exception.DfFixedConditionInvalidClassificationEmbeddedCommentException)6 ExceptionMessageBuilder (org.dbflute.helper.message.ExceptionMessageBuilder)4 DfClassificationElement (org.dbflute.properties.assistant.classification.DfClassificationElement)2 DfClassificationTop (org.dbflute.properties.assistant.classification.DfClassificationTop)2