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;
}
use of org.dbflute.jdbc.StatementConfig in project dbflute-core by dbflute.
the class TnStatementFactoryImplTest method test_getActualStatementConfig_overrideDefault.
// ===================================================================================
// OverrideDefault
// ===============
public void test_getActualStatementConfig_overrideDefault() throws Exception {
// ## Arrange ##
TnStatementFactoryImpl impl = new TnStatementFactoryImpl();
{
StatementConfig defaultConfig = new StatementConfig();
defaultConfig.queryTimeout(10).fetchSize(20).maxRows(30);
impl.setDefaultStatementConfig(defaultConfig);
}
StatementConfig config = new StatementConfig();
config.queryTimeout(1).fetchSize(2).maxRows(3);
// ## Act ##
StatementConfig actual = impl.getActualStatementConfig(config);
// ## Assert ##
assertNotNull(actual);
assertEquals(1, actual.getQueryTimeout());
assertEquals(2, actual.getFetchSize());
assertEquals(3, actual.getMaxRows());
}
use of org.dbflute.jdbc.StatementConfig in project dbflute-core by dbflute.
the class TnStatementFactoryImplTest method test_getResultSetType_overrideDefault.
public void test_getResultSetType_overrideDefault() throws Exception {
// ## Arrange ##
TnStatementFactoryImpl impl = new TnStatementFactoryImpl();
StatementConfig defaultConfig = new StatementConfig();
defaultConfig.typeScrollSensitive();
impl.setDefaultStatementConfig(defaultConfig);
StatementConfig config = new StatementConfig();
config.typeScrollInsensitive();
// ## Act ##
int resultSetType = impl.getResultSetType(config);
// ## Assert ##
assertEquals(ResultSet.TYPE_SCROLL_INSENSITIVE, resultSetType);
}
use of org.dbflute.jdbc.StatementConfig in project dbflute-core by dbflute.
the class TnStatementFactoryImplTest method test_getActualStatementConfig_suppressDefault.
// ===================================================================================
// SuppressDefault
// ===============
public void test_getActualStatementConfig_suppressDefault() throws Exception {
// ## Arrange ##
TnStatementFactoryImpl impl = new TnStatementFactoryImpl();
{
StatementConfig defaultConfig = new StatementConfig();
defaultConfig.queryTimeout(10).fetchSize(20).maxRows(30);
impl.setDefaultStatementConfig(defaultConfig);
}
StatementConfig config = new StatementConfig();
config.suppressDefault();
config.fetchSize(2);
// ## Act ##
StatementConfig actual = impl.getActualStatementConfig(config);
// ## Assert ##
assertNotNull(actual);
assertEquals(null, actual.getQueryTimeout());
assertEquals(2, actual.getFetchSize());
assertEquals(null, actual.getMaxRows());
}
use of org.dbflute.jdbc.StatementConfig in project dbflute-core by dbflute.
the class TnStatementFactoryImplTest method test_getActualStatementConfig_request.
public void test_getActualStatementConfig_request() throws Exception {
// ## Arrange ##
TnStatementFactoryImpl impl = new TnStatementFactoryImpl();
StatementConfig config = new StatementConfig();
config.queryTimeout(1).fetchSize(2).maxRows(3);
// ## Act ##
StatementConfig actual = impl.getActualStatementConfig(config);
// ## Assert ##
assertNotNull(actual);
assertEquals(1, actual.getQueryTimeout());
assertEquals(2, actual.getFetchSize());
assertEquals(3, actual.getMaxRows());
}
Aggregations