Search in sources :

Example 1 with BehaviorInvokeNameExtractor

use of org.dbflute.bhv.logging.invoke.BehaviorInvokeNameExtractor in project dbflute-core by dbflute.

the class BehaviorCommandInvoker method extractBehaviorInvoke.

// -----------------------------------------------------
// Extract BehaviorInvoke
// ----------------------
protected <RESULT> BehaviorInvokeNameResult extractBehaviorInvoke(BehaviorCommand<RESULT> behaviorCommand, StackTraceElement[] stackTrace) {
    final DBMeta dbmeta = ResourceContext.provideDBMeta(behaviorCommand.getTableDbName());
    if (dbmeta == null) {
        // basically no way, only direct invoking
        return createUnknownInvokeNameResult();
    }
    Class<?> outsideSqlResultType = null;
    boolean outsideSqlAutoPaging = false;
    if (behaviorCommand.isOutsideSql()) {
        final OutsideSqlContext outsideSqlContext = getOutsideSqlContext();
        outsideSqlResultType = outsideSqlContext.getResultType();
        outsideSqlAutoPaging = outsideSqlContext.isAutoPagingLogging();
    }
    final BehaviorInvokeNameExtractor extractor = createBehaviorInvokeNameExtractor(dbmeta, outsideSqlResultType, outsideSqlAutoPaging);
    return extractor.extractBehaviorInvoke(stackTrace);
}
Also used : DBMeta(org.dbflute.dbmeta.DBMeta) OutsideSqlContext(org.dbflute.outsidesql.OutsideSqlContext) BehaviorInvokeNameExtractor(org.dbflute.bhv.logging.invoke.BehaviorInvokeNameExtractor)

Aggregations

BehaviorInvokeNameExtractor (org.dbflute.bhv.logging.invoke.BehaviorInvokeNameExtractor)1 DBMeta (org.dbflute.dbmeta.DBMeta)1 OutsideSqlContext (org.dbflute.outsidesql.OutsideSqlContext)1