Search in sources :

Example 1 with SqlAnalyzerFactory

use of org.dbflute.twowaysql.factory.SqlAnalyzerFactory in project dbflute-core by dbflute.

the class AbstractConditionBean method toDisplaySql.

// ===================================================================================
// DisplaySQL
// ==========
/**
 * {@inheritDoc}
 */
public String toDisplaySql() {
    final SqlAnalyzerFactory factory = getSqlAnalyzerFactory();
    final BoundDateDisplayStyle realStyle;
    final BoundDateDisplayStyle specifiedStyle = getLogDateDisplayStyle();
    if (specifiedStyle != null) {
        realStyle = specifiedStyle;
    } else {
        realStyle = createConfiguredBoundDateDisplayStyle();
    }
    return convertConditionBean2DisplaySql(factory, this, realStyle);
}
Also used : SqlAnalyzerFactory(org.dbflute.twowaysql.factory.SqlAnalyzerFactory) BoundDateDisplayStyle(org.dbflute.twowaysql.style.BoundDateDisplayStyle)

Example 2 with SqlAnalyzerFactory

use of org.dbflute.twowaysql.factory.SqlAnalyzerFactory in project dbflute-core by dbflute.

the class ResourceContext method createSqlAnalyzer.

public static SqlAnalyzer createSqlAnalyzer(String sql, boolean blockNullParameter) {
    assertResourceContextExists();
    final ResourceContext context = getResourceContextOnThread();
    final SqlAnalyzerFactory factory = context.getSqlAnalyzerFactory();
    if (factory == null) {
        String msg = "The factory of SQL analyzer should exist:";
        msg = msg + " sql=" + sql + " blockNullParameter=" + blockNullParameter;
        throw new IllegalStateException(msg);
    }
    final SqlAnalyzer created = factory.create(sql, blockNullParameter);
    if (created != null) {
        return created;
    }
    String msg = "The factory should not return null:";
    msg = msg + " sql=" + sql + " factory=" + factory;
    throw new IllegalStateException(msg);
}
Also used : SqlAnalyzerFactory(org.dbflute.twowaysql.factory.SqlAnalyzerFactory) SqlAnalyzer(org.dbflute.twowaysql.SqlAnalyzer)

Aggregations

SqlAnalyzerFactory (org.dbflute.twowaysql.factory.SqlAnalyzerFactory)2 SqlAnalyzer (org.dbflute.twowaysql.SqlAnalyzer)1 BoundDateDisplayStyle (org.dbflute.twowaysql.style.BoundDateDisplayStyle)1