using spring jdbc template for populating results
问题 I have two classes class Deptartment{ int deptid, String deptname; List<Employee> employees; } class Employee{ int empid; String empname; int deptid; } Table: Department: deptid,deptname Employee empid,empname,deptid Query: select * from deptartment d,employee e where d.deptid= e.deptid Now how can i populate Department object using spring jdbc template? 回答1: To help Sean Patrick Floyd, here's his solution with a single query : final Map<Integer, Department> departments = new HashMap<Integer,