二、定义实体类与DB表
1 public class Student { 2 private Integer id; 3 private String name; 4 private int age; 5 6 7 public Student() { 8 super(); 9 } 10 11 public Student( String name, int age) { 12 super(); 13 this.name = name; 14 this.age = age; 15 } 16 17 public Integer getId() { 18 return id; 19 } 20 21 public void setId(Integer id) { 22 this.id = id; 23 } 24 25 public String getName() { 26 return name; 27 } 28 29 public void setName(String name) { 30 this.name = name; 31 } 32 33 public int getAge() { 34 return age; 35 } 36 37 public void setAge(int age) { 38 this.age = age; 39 } 40 41 @Override 42 public String toString() { 43 return "Student [id=" + id + ",, age=" + age + "]"; 44 } 45 46 }