Example usage for org.apache.ibatis.session LocalCacheScope STATEMENT

List of usage examples for org.apache.ibatis.session LocalCacheScope STATEMENT

Introduction

In this page you can find the example usage for org.apache.ibatis.session LocalCacheScope STATEMENT.

Prototype

LocalCacheScope STATEMENT

To view the source code for org.apache.ibatis.session LocalCacheScope STATEMENT.

Click Source Link

Usage

From source file:org.mybatis.guice.configuration.settings.LocalCacheScopeConfigurationSettingTest.java

License:Apache License

@Test
public void applyConfigurationSetting_Statement() {
    LocalCacheScopeConfigurationSetting setting = new LocalCacheScopeConfigurationSetting(
            LocalCacheScope.STATEMENT);
    setting.applyConfigurationSetting(configuration);
    verify(configuration).setLocalCacheScope(LocalCacheScope.STATEMENT);
}

From source file:org.mybatis.guice.MyBatisModuleTest.java

License:Apache License

@Test
public void localCacheScope() {
    Injector injector = Guice.createInjector(new MyBatisModule() {
        @Override//from   w  w w .  j  av  a2 s.  c  o m
        protected void initialize() {
            localCacheScope(LocalCacheScope.STATEMENT);
            environmentId("test_environment");
            bindDataSourceProvider(dataSourceProvider);
            bindTransactionFactory(transactionFactoryProvider);
        }
    });

    Configuration configuration = injector.getInstance(Configuration.class);

    assertEquals(LocalCacheScope.STATEMENT, configuration.getLocalCacheScope());
}