實體類School學校
public class School {
private Integer SchoolId;
private String SchoolName;
private List<Student>list;
...
}
學生類
public class Student {
private Integer StudentId;
private String StudentName;
...
}
Mapper中BaseResultMap使用<collection>便籤連接
其中標籤內參數property值爲實體類School中List集合名,javaType是類型名,ofType是對應實體類指定對象類型的