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

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

Introduction

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

Prototype

LocalCacheScope SESSION

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

Click Source Link

Usage

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

License:Apache License

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

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

License:Apache License

@Test
public void localCacheScope_Default() {
    Injector injector = Guice.createInjector(new MyBatisModule() {
        @Override//from w w w.j  a v  a  2s .  co  m
        protected void initialize() {
            environmentId("test_environment");
            bindDataSourceProvider(dataSourceProvider);
            bindTransactionFactory(transactionFactoryProvider);
        }
    });

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

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