zoukankan      html  css  js  c++  java
  • springboot + mybatis 查询结果为null字段不显示

    @Primary
    @Bean(name = "sysSqlSessionFactory")
    public SqlSessionFactory setSqlSessionFactory(@Qualifier("sysDataSource") DataSource dataSource) throws Exception {
    SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
    bean.setDataSource(dataSource);
      //设置为true 为null字段也会查询出来
    bean.getObject().getConfiguration().setCallSettersOnNulls(true);
    org.apache.ibatis.session.Configuration configuration = new org.apache.ibatis.session.Configuration();
    configuration.setMapUnderscoreToCamelCase(true);
    bean.setConfiguration(configuration);
    bean.setMapperLocations(resolveMapperLocations());
    bean.setConfigurationProperties(resolveMapperProperties());
    return bean.getObject();
    }
  • 相关阅读:
    LG4762 Virus synthesis
    深入浅出Vue.js(一) 变化侦测
    LRU
    时间复杂度 & 空间复杂度
    rem的实现原理
    瀑布流布局
    ts-不懂强记
    Notification
    Grid & Flex
    交换两个变量的值
  • 原文地址:https://www.cnblogs.com/sanshao-ghf/p/15075439.html
Copyright © 2011-2022 走看看