我的Map器界面就像
public interface InstructorMapper {
final String getEmailUsers = "SELECT email, COUNT(*) AS users FROM instructor GROUP BY email";
@Select(getEmailUsers)
List<Map<String,Integer>> getEmailUsers();
}
主要代码如下。
List<Map<String,Integer>> users = instructorMapper.getEmailUsers();
System.out.println(users); //prints everything as null
System.out.println(users.size()); //prints 200, Beacause there are 200 records in the instructor table
我还尝试遍历列表中的各个Map条目,并尝试打印它们的keyset()和values(),但所有内容都只打印null。这里发生了什么?有没有越橘Maven?
1条答案
按热度按时间wgmfuz8q1#
尝试?