#四.mybatis-confg.xml配置文件全面解析

1.简要说明
   
The MyBatis configuration contains settings and properties that have a dramatic effect on how MyBatis behaves.
    MyBatis的XML配置文件包含了影响MyBatis行为甚深的设置和属性信息。

2.properties
  
   

3.settings全局参数定义
    参照官方文档3.1.2节
   
       
       

       
       

       

       
       

       
       

       
       

       
       

       
       

       
       

   

4.typeAliases别名处理器
    别名是为Java类型命名一个短的名字。它只和XML配置有关,只用来减少类名重复的部分。在mybatis-config.xml中配置后会影响XxxMapper.xml的使用。
    ①单个配置
      
 
       
           
           
       

       
       
            INSERT INTO tbl_cust (cust_name, cust_age) VALUES (#{custName}, #{custAge})
       

    ②批量配置 (推荐)
      
 
           
       

       
       
            INSERT INTO tbl_cust (cust_name, cust_age) VALUES (#{custName}, #{custAge})
       

5.typeHandlers类型处理器
   MyBatis支持基本数据类型和常用数据类型的自动识别和自动类型转换,一般也不需要自定义类型转换器。

6.mappers
   
   

   
   

   
   

   
   

你可能感兴趣的:(mybatis)