Search in sources :

Example 1 with OnQueryStringConnector

use of org.dbflute.dbway.OnQueryStringConnector in project dbflute-core by dbflute.

the class ConditionKey method resolveCompoundColumn.

protected ColumnRealName resolveCompoundColumn(ColumnRealName baseRealName, ConditionOption option) {
    if (option == null || !option.hasCompoundColumn()) {
        return baseRealName;
    }
    if (!option.hasStringConnector()) {
        // basically no way
        String msg = "The option should have string connector when compound column is specified: " + option;
        throw new IllegalConditionBeanOperationException(msg);
    }
    final List<SpecifiedColumn> compoundColumnList = option.getCompoundColumnList();
    final List<ColumnRealName> realNameList = new ArrayList<ColumnRealName>();
    // already cipher
    realNameList.add(doResolveCompoundColumnOption(option, baseRealName));
    for (SpecifiedColumn specifiedColumn : compoundColumnList) {
        realNameList.add(doResolveCompoundColumnOption(option, doResolveCompoundColumnCipher(option, specifiedColumn)));
    }
    final OnQueryStringConnector stringConnector = option.getStringConnector();
    final String connected = stringConnector.connect(realNameList.toArray());
    return ColumnRealName.create(null, new ColumnSqlName(connected));
}
Also used : ColumnSqlName(org.dbflute.dbmeta.name.ColumnSqlName) IllegalConditionBeanOperationException(org.dbflute.exception.IllegalConditionBeanOperationException) ArrayList(java.util.ArrayList) SpecifiedColumn(org.dbflute.cbean.dream.SpecifiedColumn) ColumnRealName(org.dbflute.dbmeta.name.ColumnRealName) OnQueryStringConnector(org.dbflute.dbway.OnQueryStringConnector)

Aggregations

ArrayList (java.util.ArrayList)1 SpecifiedColumn (org.dbflute.cbean.dream.SpecifiedColumn)1 ColumnRealName (org.dbflute.dbmeta.name.ColumnRealName)1 ColumnSqlName (org.dbflute.dbmeta.name.ColumnSqlName)1 OnQueryStringConnector (org.dbflute.dbway.OnQueryStringConnector)1 IllegalConditionBeanOperationException (org.dbflute.exception.IllegalConditionBeanOperationException)1