SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
Properties settingsProperties = new Properties();
// 使用log4j输出jdbc日志
settingsProperties.setProperty("logImpl", "LOG4J");
sqlSessionFactoryBean.setConfigurationProperties(settingsProperties);
//查询返回Map时设置值为null
org.apache.ibatis.session.Configuration configuration = new org.apache.ibatis.session.Configuration();
configuration.setCallSettersOnNulls(true);
sqlSessionFactoryBean.setConfiguration(configuration);
springboot +mybatis callSettersOnNulls=true 解决使用map接收返回值值为null的问题,默认是当值为null,不会将key返回
最新推荐文章于 2024-05-14 14:24:22 发布