文档介绍:MyBatis 存储过程、 MyBatis 分页、 MyBatis 一对多增删改查操作一、用到的实体类如下: [html] view plaincopy 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. .; import ; import ; public class Student implements Serializable{ private static final long serialVersionUID = 1L; private int id; private String name; private Date birth; private Group group; public Group getGroup() { return group; } public void setGroup(Group group) { = group; } public int getId() { return id;} public void setId(int id) { = id;} public String getName() { return name; } public void setName(String name) { = name; } 33. 34. 35. 36. 37. 38. 39. 40. 41. public Date getBirth() { return birth; } public void setBirth(Date birth) { = birth; } ***@Override public String toString() { return "Student [birth=" + birth + ", group=" + group + ", id=" + id + ", name=" + name + "]"; } } 42. 43. 44. 45. 46. [java] view plaincopy 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. .; import ; public class Group { private int id; private String name; private String position; private List<Student> students; public List<Student> getStudents() { return students; } public void setStudents(List<Student> students) { = students; } public int getId() { return id;} public void setId(int id) { = id;} 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. on public String getName() { return name; } public void setName(String name) { = name; } public String getPosition() { return position; } public void setPosition(String position) { = position; } ***@Override public String toString() { return "Group [id=" + id+ ", name=" + name + ", position=" + positi + "]"; }} 39. 40. 41. 42. 二、实体对应的表结构 student 表: create table student( id int primary key, name varchar(2