Search in sources :

Example 1 with SqlFireHook

use of org.dbflute.hook.SqlFireHook in project lastaflute by lastaflute.

the class SimpleAsyncManager method doInheritCallbackContext.

protected CallbackContext doInheritCallbackContext(ConcurrentAsyncCall call) {
    // null allowed
    final CallbackContext src = CallbackContext.getCallbackContextOnThread();
    if (src == null) {
        return null;
    }
    final CallbackContext dest = newCallbackContext();
    final ConcurrentAsyncOption option = call.option();
    final ConcurrentAsyncOption defaultOption = defaultConcurrentAsyncOption;
    if (isInherit(option.getBehaviorCommandHookType(), defaultOption.getBehaviorCommandHookType())) {
        final BehaviorCommandHook hook = src.getBehaviorCommandHook();
        if (hook != null) {
            dest.setBehaviorCommandHook(hook);
        }
    }
    if (isInherit(option.getSqlFireHookType(), defaultOption.getSqlFireHookType())) {
        final SqlFireHook hook = src.getSqlFireHook();
        if (hook != null) {
            dest.setSqlFireHook(hook);
        }
    } else {
        // as default
        dest.setSqlFireHook(createDefaultSqlFireHook(call));
    }
    if (isInherit(option.getSqlLogHandlerType(), defaultOption.getSqlLogHandlerType())) {
        final SqlLogHandler handler = src.getSqlLogHandler();
        if (handler != null) {
            dest.setSqlLogHandler(handler);
        }
    }
    if (isInherit(option.getSqlResultHandlerType(), defaultOption.getSqlResultHandlerType())) {
        final SqlResultHandler handler = src.getSqlResultHandler();
        if (handler != null) {
            dest.setSqlResultHandler(handler);
        }
    } else {
        dest.setSqlResultHandler(createDefaultSqlResultHandler(call));
    }
    if (isInherit(option.getSqlStringFilterType(), defaultOption.getSqlStringFilterType())) {
        final SqlStringFilter filter = src.getSqlStringFilter();
        if (filter != null) {
            dest.setSqlStringFilter(filter);
        }
    } else {
        // as default
        dest.setSqlStringFilter(createDefaultSqlStringFilter(call));
    }
    return dest;
}
Also used : SqlLogHandler(org.dbflute.hook.SqlLogHandler) SqlResultHandler(org.dbflute.hook.SqlResultHandler) RomanticTraceableSqlResultHandler(org.lastaflute.db.dbflute.callbackcontext.traceablesql.RomanticTraceableSqlResultHandler) RomanticTraceableSqlStringFilter(org.lastaflute.db.dbflute.callbackcontext.traceablesql.RomanticTraceableSqlStringFilter) SqlStringFilter(org.dbflute.hook.SqlStringFilter) BehaviorCommandHook(org.dbflute.bhv.core.BehaviorCommandHook) CallbackContext(org.dbflute.hook.CallbackContext) RomanticTraceableSqlFireHook(org.lastaflute.db.dbflute.callbackcontext.traceablesql.RomanticTraceableSqlFireHook) SqlFireHook(org.dbflute.hook.SqlFireHook)

Aggregations

BehaviorCommandHook (org.dbflute.bhv.core.BehaviorCommandHook)1 CallbackContext (org.dbflute.hook.CallbackContext)1 SqlFireHook (org.dbflute.hook.SqlFireHook)1 SqlLogHandler (org.dbflute.hook.SqlLogHandler)1 SqlResultHandler (org.dbflute.hook.SqlResultHandler)1 SqlStringFilter (org.dbflute.hook.SqlStringFilter)1 RomanticTraceableSqlFireHook (org.lastaflute.db.dbflute.callbackcontext.traceablesql.RomanticTraceableSqlFireHook)1 RomanticTraceableSqlResultHandler (org.lastaflute.db.dbflute.callbackcontext.traceablesql.RomanticTraceableSqlResultHandler)1 RomanticTraceableSqlStringFilter (org.lastaflute.db.dbflute.callbackcontext.traceablesql.RomanticTraceableSqlStringFilter)1