【关联集合对象】1.Teacher.java
private List list;//添加list,查找老师的所有学生
2.TeacherMapper.xml
select * from teacher
3.StudentMapper.xml
select * from student where tid=#{0}
使用
1.在TeacherMapper.xml中配置
select t.id tid,t.name tname,s.id sid.s.name sname,age,tid from teacher t LEFT JOIN student s on t.id=s.id