Mapper
public interface ProvinceMapper {
public List<Province> getProvinceTree(Province province);
}
实体类
public class Province {
private String code;
private String belongCode;
private String provinceName;
@Transient // javax.persistence.Transient
private List<City> cityList;
... 省略set/get方法
}
public class City {
private String code;
private String belongCode;
private String cityName;
@Transient // javax.persistence.Transient
private List<County> countyList;
... 省略set/get方法
}
public class County {
private String code;
private String belongCode;
private String countyName;
... 省略set/get方法
}
第一种方式:在XML中多表关联查询
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTY