Search in sources :

Example 1 with UnionClauseProvider

use of org.dbflute.cbean.sqlclause.union.UnionClauseProvider in project dbflute-core by dbflute.

the class AbstractSqlClause method prepareUnionClause.

protected String prepareUnionClause(String selectClause) {
    if (!hasUnionQuery()) {
        return "";
    }
    final StringBuilder sb = new StringBuilder();
    for (UnionQueryInfo unionQueryInfo : _unionQueryInfoList) {
        final UnionClauseProvider unionClauseProvider = unionQueryInfo.getUnionClauseProvider();
        final String unionQueryClause = unionClauseProvider.provide();
        final boolean unionAll = unionQueryInfo.isUnionAll();
        sb.append(ln()).append(unionAll ? " union all " : " union ").append(ln());
        sb.append(selectClause).append(" ").append(unionQueryClause);
    }
    return sb.toString();
}
Also used : UnionClauseProvider(org.dbflute.cbean.sqlclause.union.UnionClauseProvider)

Aggregations

UnionClauseProvider (org.dbflute.cbean.sqlclause.union.UnionClauseProvider)1