MyBatis驼峰命名方法问题解决方法

springboot链接数据库

import org.apache.ibatis.session.Configuration;
import org.mybatis.spring.boot.autoconfigure.ConfigurationCustomizer;
import org.springframework.context.annotation.Bean;

/**
 * @author liwen406
 * @Title: MyBatisconfig
 * @Description:
 * @date 2019/1/6 / 22:25
 */
@org.springframework.context.annotation.Configuration
public class MyBatisconfig {

    //解决MyBatis驼峰命名方法
    @Bean
   public ConfigurationCustomizer configurationCustomizer(){
      return new ConfigurationCustomizer(){

           @Override
           public void customize(Configuration configuration) {
               configuration.setMapUnderscoreToCamelCase(true);
           }
       };
   }

}

mybatis-config.xml

xml





    
        
    

转载于:https://blog.51cto.com/357712148/2371951

你可能感兴趣的:(MyBatis驼峰命名方法问题解决方法)