Mybatis ReflectionException: There is no getter for property named 'distinct' in 'class tk.mybati...

背景,一次在使用Mybatis时,出现了org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'distinct' in 'class tk.mybatis.mapper.entity.Example$Criteria'
1、代码如下
@GetMapping("select")
    public void select(Long id) {
        Example example = new Example(Account.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("id", id);
        List accountList = accountMapper.selectByExample(criteria);
        log.info("accountList:{}", accountList);
    }
2、修改如下
@GetMapping("select")
    public void select(Long id) {
        Example example = new Example(Account.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("id", id);
        List accountList = accountMapper.selectByExample(example);
        log.info("accountList:{}", accountList);
    }
image.png
希望对你有所帮助

你可能感兴趣的:(Mybatis ReflectionException: There is no getter for property named 'distinct' in 'class tk.mybati...)