Search in sources :

Example 1 with StatementConfig

use of org.dbflute.jdbc.StatementConfig in project dbflute-core by dbflute.

the class OutsideSqlAllFacadeExecutor method createStatementConfig.

protected StatementConfig createStatementConfig(StatementConfigCall<StatementConfig> configCall) {
    if (configCall == null) {
        throw new IllegalArgumentException("The argument 'confLambda' should not be null.");
    }
    final StatementConfig config = newStatementConfig();
    configCall.callback(config);
    return config;
}
Also used : StatementConfig(org.dbflute.jdbc.StatementConfig)

Example 2 with StatementConfig

use of org.dbflute.jdbc.StatementConfig in project dbflute-core by dbflute.

the class TnStatementFactoryImpl method getActualStatementConfig.

protected StatementConfig getActualStatementConfig(StatementConfig config) {
    final StatementConfig defaultConfig = getActualDefaultConfig(config);
    final Integer queryTimeout = getActualQueryTimeout(config, defaultConfig);
    final Integer fetchSize = getActualFetchSize(config, defaultConfig);
    final Integer maxRows = getActualMaxRows(config, defaultConfig);
    if (queryTimeout == null && fetchSize == null && maxRows == null) {
        return null;
    }
    final StatementConfig actualConfig = new StatementConfig();
    actualConfig.queryTimeout(queryTimeout).fetchSize(fetchSize).maxRows(maxRows);
    return actualConfig;
}
Also used : StatementConfig(org.dbflute.jdbc.StatementConfig)

Example 3 with StatementConfig

use of org.dbflute.jdbc.StatementConfig in project dbflute-core by dbflute.

the class TnStatementFactoryImpl method findStatementConfigOnThread.

// -----------------------------------------------------
// StatementConfig
// ---------------
protected StatementConfig findStatementConfigOnThread() {
    final StatementConfig config;
    if (ConditionBeanContext.isExistConditionBeanOnThread()) {
        final ConditionBean cb = ConditionBeanContext.getConditionBeanOnThread();
        config = cb.getStatementConfig();
    } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) {
        final OutsideSqlContext context = OutsideSqlContext.getOutsideSqlContextOnThread();
        config = context.getStatementConfig();
    } else {
        // update or no exist
        config = InternalMapContext.getUpdateStatementConfig();
    }
    return config;
}
Also used : OutsideSqlContext(org.dbflute.outsidesql.OutsideSqlContext) ConditionBean(org.dbflute.cbean.ConditionBean) StatementConfig(org.dbflute.jdbc.StatementConfig)

Example 4 with StatementConfig

use of org.dbflute.jdbc.StatementConfig in project dbflute-core by dbflute.

the class InsertOption method createStatementConfig.

protected StatementConfig createStatementConfig(StatementConfigCall<StatementConfig> configCall) {
    if (configCall == null) {
        throw new IllegalArgumentException("The argument 'confLambda' should not be null.");
    }
    final StatementConfig config = newStatementConfig();
    configCall.callback(config);
    return config;
}
Also used : StatementConfig(org.dbflute.jdbc.StatementConfig)

Example 5 with StatementConfig

use of org.dbflute.jdbc.StatementConfig in project dbflute-core by dbflute.

the class TnStatementFactoryImplTest method test_getActualStatementConfig_cursorSelectFetchSize_notCursor_plain.

public void test_getActualStatementConfig_cursorSelectFetchSize_notCursor_plain() throws Exception {
    // ## Arrange ##
    TnStatementFactoryImpl impl = new TnStatementFactoryImpl() {

        @Override
        protected boolean isSelectCursorFetchSizeCommand(BehaviorCommand<?> command) {
            return false;
        }
    };
    impl.setCursorSelectFetchSize(200);
    // ## Act ##
    StatementConfig actual = impl.getActualStatementConfig(null);
    // ## Assert ##
    assertNull(actual);
}
Also used : StatementConfig(org.dbflute.jdbc.StatementConfig) BehaviorCommand(org.dbflute.bhv.core.BehaviorCommand)

Aggregations

StatementConfig (org.dbflute.jdbc.StatementConfig)29 BehaviorCommand (org.dbflute.bhv.core.BehaviorCommand)6 CallableStatement (java.sql.CallableStatement)1 PreparedStatement (java.sql.PreparedStatement)1 ConditionBean (org.dbflute.cbean.ConditionBean)1 OutsideSqlContext (org.dbflute.outsidesql.OutsideSqlContext)1