String hql = "SELECT max(age) as a, min(age) as i FROM Student where id = "+id+";
this.getSession().createQuery(hql).....;
请问我如何取 a 和 i 的值??
String hql = "SELECT max(age) as a, min(age) as i FROM Student where id = "+id+";
this.getSession().createQuery(hql).....;
请问我如何取 a 和 i 的值??
Object[] objs = (Object[]) list.get(0);
String sA = objs[0].toString();// 这里要注意判断,当值为null时或数组长度小于1就会出现异常
String sI = objs[1].toString();// 同上