hibernate多表查询sql,以及所得对象的处理
String sql ="SELECT id FROM tea WHERE tea.name=? ";
SQLQuery query = this.getSession().createSQLQuery(sql);
//设置参数
Query q = query.setParameter(0, teachers[0]);
List list = q.list();
Iterator iterator = list.iterator();
while(iterator.hasNext()){
Integer id = (Integer) iterator.next();
}
}