Example usage for org.apache.ibatis.session AutoMappingBehavior NONE

List of usage examples for org.apache.ibatis.session AutoMappingBehavior NONE

Introduction

In this page you can find the example usage for org.apache.ibatis.session AutoMappingBehavior NONE.

Prototype

AutoMappingBehavior NONE

To view the source code for org.apache.ibatis.session AutoMappingBehavior NONE.

Click Source Link

Document

Disables auto-mapping.

Usage

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

License:Apache License

@Test
public void applyConfigurationSetting_None() {
    AutoMappingBehaviorConfigurationSetting setting = new AutoMappingBehaviorConfigurationSetting(
            AutoMappingBehavior.NONE);
    setting.applyConfigurationSetting(configuration);
    verify(configuration).setAutoMappingBehavior(AutoMappingBehavior.NONE);
}

From source file:org.ownchan.server.persistence.config.PersistenceConfig.java

License:GNU General Public License

/**
 * Create a Mybatis Configuration instance for ownchan-server.
 * @param defaultFetchSize if not set (null), then the default fetch size of the applicable JDBC driver will be used
 *//*from  ww w  . j a v  a 2s .  c  o m*/
public static org.apache.ibatis.session.Configuration createOwnchanServerMybatisConfiguration(
        Integer defaultFetchSize) {
    org.apache.ibatis.session.Configuration config = new org.apache.ibatis.session.Configuration();
    /*
     * We do use ehcache, but we avoid using org.mybatis.caches.ehcache.EhcacheCache
     * and use dto service method level caching annotations instead.
     */
    config.setCacheEnabled(false);
    config.setLazyLoadingEnabled(true);
    config.setAggressiveLazyLoading(false);
    config.setLazyLoadTriggerMethods(new HashSet<>(Arrays.asList("clone", "detach")));
    config.setJdbcTypeForNull(JdbcType.NULL);
    config.setDefaultExecutorType(ExecutorType.BATCH);
    config.setAutoMappingBehavior(AutoMappingBehavior.NONE);
    config.setVfsImpl(SpringBootVFS.class);
    config.setDefaultFetchSize(defaultFetchSize);

    return config;
}