可以用如下的代码把其中的字段取出来:
StringBuffer sbDeviceId = new StringBuffer();
sbDeviceId.append("select deviceId as deviceId ,city as city, deviceType as deviceType from UniqueDevice where firstActiveTime >='" + dayBefore+ " 00:00:00'" + " and firstActiveTime <='" + dayBefore + " 23:59:59' and firstEffectTime is not null and firstEffectTime!='"+"'");
sbDeviceId.append(" and city = '" + city + "'");
sbDeviceId.append(" and deviceType = '" + deviceType + "'");
List listDeviceId = getHibernateTemplate().find(sbDeviceId.toString());
for (int i=0; i<listDeviceId.size(); i++) {Object[] object = (Object[]) listDeviceId.get(i);
String deviceId = (String)object[0];
String city = (String) object[1];
String deviceType = (String) object[2];
}