Search in sources :

Example 21 with StatementConfig

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

the class TnStatementFactoryImplTest method test_getActualStatementConfig_cursorSelectFetchSize_cursor_suppressDefault.

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

        @Override
        protected boolean isSelectCursorFetchSizeCommand(BehaviorCommand<?> command) {
            return true;
        }
    };
    {
        StatementConfig defaultConfig = new StatementConfig();
        defaultConfig.queryTimeout(10).fetchSize(20).maxRows(30);
        impl.setDefaultStatementConfig(defaultConfig);
    }
    impl.setCursorSelectFetchSize(200);
    StatementConfig config = new StatementConfig();
    config.suppressDefault();
    config.queryTimeout(1);
    // ## Act ##
    StatementConfig actual = impl.getActualStatementConfig(config);
    // ## Assert ##
    assertNotNull(actual);
    assertEquals(1, actual.getQueryTimeout());
    assertEquals(null, actual.getFetchSize());
    assertEquals(null, actual.getMaxRows());
}
Also used : StatementConfig(org.dbflute.jdbc.StatementConfig) BehaviorCommand(org.dbflute.bhv.core.BehaviorCommand)

Example 22 with StatementConfig

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

the class TnStatementFactoryImplTest method test_getActualStatementConfig_plain.

public void test_getActualStatementConfig_plain() throws Exception {
    // ## Arrange ##
    TnStatementFactoryImpl impl = new TnStatementFactoryImpl();
    // ## Act ##
    StatementConfig actual = impl.getActualStatementConfig(null);
    // ## Assert ##
    assertNull(actual);
}
Also used : StatementConfig(org.dbflute.jdbc.StatementConfig)

Example 23 with StatementConfig

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

the class AbstractOutsideSqlPagingExecutor method setupScrollableCursorIfNeeds.

protected void setupScrollableCursorIfNeeds() {
    if (!_outsideSqlOption.isAutoPaging()) {
        return;
    }
    StatementConfig statementConfig = _outsideSqlOption.getStatementConfig();
    if (statementConfig != null && statementConfig.hasResultSetType()) {
        return;
    }
    if (statementConfig == null) {
        statementConfig = new StatementConfig();
        configure(statementConfig);
    }
    if (_currentDBDef.dbway().isScrollableCursorSupported()) {
        statementConfig.typeScrollInsensitive();
    } else {
        statementConfig.typeForwardOnly();
    }
}
Also used : StatementConfig(org.dbflute.jdbc.StatementConfig)

Example 24 with StatementConfig

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

the class UpdateOption 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 25 with StatementConfig

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

the class AbstractConditionBean 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)

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