Mybatis---一分钟学会Mybatis分页插件
还不会使用mybatis的建议看看我以往的文章:
Mybatis入门—如何使用mybatis查询数据库数据
一、mybatis四步走(实体类、Mapper接口、Mapper.xml配置、mybatis-config.xml配置)
Person类
public class Person {
private Integer id;
private String name;
private Date birthday;
private String address;
private Car car;//一个用户拥有一个car
private List<Order> orderList;//一个用户拥有多个订单
public Person() {
}
public Person(Integer id, String name, Date birthday, String address, Car car, List<Order> orderList) {
this.id = id;
this.name = name;
this.birthday = birthday;
this.address = address;
this.car = car;
this.orderList = orderList;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;