• 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")));
        }
  • 相关阅读:
    视频实例分割 | Target-Aware Adaptive Tracking for Unsupervised Video Object Segmentation
    目标检测算法:Selective Search(选择性搜索)简述
    [2020BUAA软工助教]期末总结
    WPF,数据验证方案,验证通过才能继续下一步
    WPF:解决数据验证ValidationRule与按钮Canexcute联动的问题
    解决mininet运行报错“ImportError: No module named mininet.log”
    交易所对接ERC20钱包端口要多长时间?
    尺子的刻度
    学习java的第四周
    学习java的第三周
  • 原文地址:https://www.cnblogs.com/tdyang/p/13847556.html
Copyright © 2020-2023  润新知