多表查询时,返回的数据分配:
比如:hql = " from table1 a,table2 b " +" where a.year = :year and a.empId in " + employeeIds Where +" and a.version = :version and a.empId = b.id and a.status in" + statusWhere;
这是对两个表的查询返回的是两个表的数据,分配时如下
for (int i = 0; i < pbscList.size(); i++) {
Object[] objects = (Object[]) pbscList.get(i);
TPbscbook pbscBook = (TPbscbook) objects[0];
Employee emp = (Employee) objects[1];
返回的集合中每条数据都包含两个表中的数据,所以在分成数组。