示例的类"TestDB"的"SearchEmployees"方法中有ArrayList转换为HashMap的代码:
......
for (int i = 0, l = dataAll.size(); i < l; i++)
{
//将ArrayList转换为HashMap
HashMap record = (HashMap)dataAll.get(i);
if (record == null) continue;
if (start <= i && i < end)
{
data.add(record);
}
}
......
在示例中运行很顺利,但我在自己的项目中运行却提示类型转换错误:
"model.UserInfo cannot be cast to java.util.Map"
"userInfo"是一个实体类
求解.