第三步创建Servlect包中有以下文件。
ITeacherServlect
TeacherServlectImp
第四部创建Controller包中有以下文件。
ITeacherController
TeacherController
第四部创建 Test包中有以下文件
TeacherTesstImp
TeacherTesst
第五部分创建Entity包中有以下文件。
TeacherTesstIm
Teacher
package Com.Teacher.Entity; import org.junit.Test; /** * 一个标准类 */ public class Teacher implements ITeacher{ private int id; private String name; private int phone; private int money; private Object date; public Teacher() { } public Teacher(int id, String name, int phone, int money, Object date) { this.id = id; this.name = name; this.phone = phone; this.money = money; this.date = date; } @Test public int getId() { return id; } @Test public void setId(int id) { this.id = id; } @Test public String getName() { return name; } @Test public void setName(String name) { this.name = name; } @Test public int getPhone() { return phone; } @Test public void setPhone(int phone) { this.phone = phone; } @Test public int getMoney() { return money; } @Test public void setMoney(int money) { this.money = money; } @Test public Object getDate() { return date; } @Test public void setDate(Object date) { this.date = date; } @Test @Override public String toString() { return "Teacher{" + "id=" + id + ", name='" + name + '\'' + ", phone=" + phone + ", money=" + money + ", date=" + date + '}'; } @Override public void X() { System.out.println("开始调用实现类的对象"); } }
数据的增删改查中实现了查。那么Spingk框架增删改如何实现呢?