为什么这样查到的数据都是null???
http://blog.csdn.net/jrainbow/article/details/51980036 照着这个弄的一个框架 以前用搭建好的框架也是这样取个别名 get set 就可以得到的呀
具体没有提供BlackList和其映射的mapper的xml文件。
看打印情况,黑名单数据是查到了,查到了2条,但是部分信息没有映射到BlackList里来,比如starttime和stoptime,userid。
检查下你的mapper文件的字段映射关系,字段名称是否和数据库字段名称的映射关系ok
package xyz.cmm.smartblocker.common.configure;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import tk.mybatis.spring.mapper.MapperScannerConfigurer;
import java.util.Properties;
/**
@since 2015-12-19 14:46
*/
@Configuration
public class MyBatisMapperScannerConfig {
@Bean
public MapperScannerConfigurer mapperScannerConfigurer() {
MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
mapperScannerConfigurer
.setSqlSessionFactoryBeanName("sqlSessionFactory");
mapperScannerConfigurer.setBasePackage("xyz.cmm.smartblocker.*.dao");
Properties properties = new Properties();
properties
.setProperty("mappers", "xyz.cmm.smartblocker.common.BaseDao");
properties.setProperty("notEmpty", "false");
properties.setProperty("IDENTITY", "MYSQL");
mapperScannerConfigurer.setProperties(properties);
return mapperScannerConfigurer;
}
}