Hibernate中HQLwhere用法和单独取出几列数据的读取方法

String hql = "select thedate,thehour,node,query_num from Cdns cdns where thehour = " +"21";
Query query = session.createQuery(hql);
List<Object[]> list = query.list();
for(Object[] object : list){
System.out.println((String)object[0]+","+(String)object[1]+","+(String)object[2]+","+(Long)object[3]);
}

2015-12-18

原文地址:https://www.cnblogs.com/zhzhang/p/5058361.html