1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| class类 student private int id; private String name; private String grade; dao层 studentDao层 insertStudent(Student student); updateStudent(Student student); delStudent(Student student); selectStudent(int id); //只测试查询,此列子 dao层的xml studentDao层xml <?xml version=“1.0” encoding=“UTF-8” ?><!DOCTYPE mapper PUBLIC “-//mybatis.org//DTD Mapper 3.0//EN” “http://mybatis.org/dtd/mybatis-3-mapper.dtd”> <mapper namespace=“org.mybatis.example.studentDao“> <select id=“selectStudent“ resultType=“student“> select * from student where id = #{id} </select> </mapper>
|