<?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="ro.cf.mybatisTutorial.EmployeeDao">
<insert id="saveEmployee" useGeneratedKeys="true" keyProperty="id">
INSERT INTO employees (emp_no, birth_date, first_name, last_name,
gender, hire_date)
VALUES ( #{emp_no}, #{birth_date}, #{first_name}, #{last_name}, #{gender},
#{hire_date} );
</insert>
<select id="getEmployeeById" resultType="ro.cf.mybatisTutorial.Employee">
SELECT * from employees WHERE emp_no = #{employeeId};
</select>
</mapper>