• mybatis配置文件中的<setting>标签的默认值


    <configuration>
    
    <properties resource="db.properties"></properties>
    <settings>
    
    <!-- 控制全局缓存(二级缓存),默认 true-->
    <setting name="cacheEnabled" value="true"/>
    
    <!-- 延迟加载的全局开关。当开启时,所有关联对象都会延迟加载。默认 false -->
    <setting name="lazyLoadingEnabled" value="true"/>
    <!-- 当开启时,任何方法的调用都会加载该对象的所有属性。默认 false,可通过select标签的 fetchType来覆盖-->
    <setting name="aggressiveLazyLoading" value="true"/>

    </settings> ..................... </configuration>

    默认设置:

     private void settingsElement(Properties props) throws Exception {
            this.configuration.setAutoMappingBehavior(AutoMappingBehavior.valueOf(props.getProperty("autoMappingBehavior", "PARTIAL")));
            this.configuration.setAutoMappingUnknownColumnBehavior(AutoMappingUnknownColumnBehavior.valueOf(props.getProperty("autoMappingUnknownColumnBehavior", "NONE")));
            this.configuration.setCacheEnabled(this.booleanValueOf(props.getProperty("cacheEnabled"), true));
            this.configuration.setProxyFactory((ProxyFactory)this.createInstance(props.getProperty("proxyFactory")));
            this.configuration.setLazyLoadingEnabled(this.booleanValueOf(props.getProperty("lazyLoadingEnabled"), false));
            this.configuration.setAggressiveLazyLoading(this.booleanValueOf(props.getProperty("aggressiveLazyLoading"), true));
            this.configuration.setMultipleResultSetsEnabled(this.booleanValueOf(props.getProperty("multipleResultSetsEnabled"), true));
            this.configuration.setUseColumnLabel(this.booleanValueOf(props.getProperty("useColumnLabel"), true));
            this.configuration.setUseGeneratedKeys(this.booleanValueOf(props.getProperty("useGeneratedKeys"), false));
            this.configuration.setDefaultExecutorType(ExecutorType.valueOf(props.getProperty("defaultExecutorType", "SIMPLE")));
            this.configuration.setDefaultStatementTimeout(this.integerValueOf(props.getProperty("defaultStatementTimeout"), (Integer)null));
            this.configuration.setDefaultFetchSize(this.integerValueOf(props.getProperty("defaultFetchSize"), (Integer)null));
            this.configuration.setMapUnderscoreToCamelCase(this.booleanValueOf(props.getProperty("mapUnderscoreToCamelCase"), false));
            this.configuration.setSafeRowBoundsEnabled(this.booleanValueOf(props.getProperty("safeRowBoundsEnabled"), false));
            this.configuration.setLocalCacheScope(LocalCacheScope.valueOf(props.getProperty("localCacheScope", "SESSION")));
            this.configuration.setJdbcTypeForNull(JdbcType.valueOf(props.getProperty("jdbcTypeForNull", "OTHER")));
            this.configuration.setLazyLoadTriggerMethods(this.stringSetValueOf(props.getProperty("lazyLoadTriggerMethods"), "equals,clone,hashCode,toString"));
            this.configuration.setSafeResultHandlerEnabled(this.booleanValueOf(props.getProperty("safeResultHandlerEnabled"), true));
            this.configuration.setDefaultScriptingLanguage(this.resolveClass(props.getProperty("defaultScriptingLanguage")));
            this.configuration.setCallSettersOnNulls(this.booleanValueOf(props.getProperty("callSettersOnNulls"), false));
            this.configuration.setUseActualParamName(this.booleanValueOf(props.getProperty("useActualParamName"), false));
            this.configuration.setLogPrefix(props.getProperty("logPrefix"));
            Class<? extends Log> logImpl = this.resolveClass(props.getProperty("logImpl"));
            this.configuration.setLogImpl(logImpl);
            this.configuration.setConfigurationFactory(this.resolveClass(props.getProperty("configurationFactory")));
        }
  • 相关阅读:
    glib 库 hash table 使用
    git 使用
    centos6.5 下安装 sqlplus
    Oracle tns 协议
    unix环境高级编程附录 B 通用代码
    centos6.5安装gtk开发环境
    linux 下定位程序假死
    Kotlin与Android SDK 集成(KAD 05)
    Kotlin的android扩展:对findViewById说再见(KAD 04)
    Kotlin类:功能更强、而更简洁(KAD 03)
  • 原文地址:https://www.cnblogs.com/tdyang/p/13847556.html
Copyright © 2020-2023  润新知