select()报错下标越界异常
/** * 名字里包含"A",且年龄小于20的 * 问题描述:执行,报错 Cause: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 * 去掉select("id", "name"),执行正常,返回两条记录. */ @Test public void selectByWrapperSuper1(){ QueryWrapper<User> query = Wrappers.query(); QueryWrapper<User> queryWrapper = query.select("id", "name").like("name", "A") .lt("age", 20); List<User> userList = userMapper.selectList(queryWrapper); userList.forEach(System.out::println); }