初学遇到翻遍后终于知道:
Query query=session.createQuery("select a.deviceVendor from DeviceTable as a group by deviceVendor");
查询一个字段得到的不是对象而是String,
List list=query.list();
int j=list.size();
System.out.println("daxiao:"+j);
for(int i=0;i<j;i++){
String NAME=(String) list.get(i)
System.out.println(i+":"+NAME+" :");
}
这样就没错了,但原因为啥,不得其解