Search in sources :

Example 1 with SpecifyExceptColumnAlreadySpecifiedColumnException

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

the class ConditionBeanExceptionThrower method throwSpecifyExceptColumnAlreadySpecifiedColumnException.

public void throwSpecifyExceptColumnAlreadySpecifiedColumnException(String tableDbName, Map<String, SpecifiedColumn> specifiedColumnMap) {
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("The SpecifyExceptColumn is specified after SpecifyColumn.");
    br.addItem("Advice");
    br.addElement("You cannot specify columns with except columns.");
    br.addElement("For example:");
    br.addElement("  (x):");
    br.addElement("    ... = memberBhv.selectList(cb -> {");
    br.addElement("        cb.specify().columnMemberName(");
    br.addElement("        cb.specify().exceptRecordMetaColumn(); // *No");
    br.addElement("    });");
    br.addElement("  (o):");
    br.addElement("    ... = memberBhv.selectList(cb -> {");
    br.addElement("        cb.specify().exceptRecordMetaColumn();");
    br.addElement("    });");
    br.addElement("  (o):");
    br.addElement("    ... = memberBhv.selectList(cb -> {");
    br.addElement("        cb.specify().columnMemberName()");
    br.addElement("    });");
    br.addItem("Base Table");
    br.addElement(tableDbName);
    if (specifiedColumnMap != null) {
        // basically true
        br.addItem("Specified Column");
        final Collection<SpecifiedColumn> columnList = specifiedColumnMap.values();
        for (SpecifiedColumn column : columnList) {
            br.addElement(column);
        }
    }
    final String msg = br.buildExceptionMessage();
    throw new SpecifyExceptColumnAlreadySpecifiedColumnException(msg);
}
Also used : ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) SpecifyExceptColumnAlreadySpecifiedColumnException(org.dbflute.exception.SpecifyExceptColumnAlreadySpecifiedColumnException) SpecifiedColumn(org.dbflute.cbean.dream.SpecifiedColumn)

Aggregations

SpecifiedColumn (org.dbflute.cbean.dream.SpecifiedColumn)1 SpecifyExceptColumnAlreadySpecifiedColumnException (org.dbflute.exception.SpecifyExceptColumnAlreadySpecifiedColumnException)1 ExceptionMessageBuilder (org.dbflute.helper.message.ExceptionMessageBuilder)1