在项目开发中,使用mybatis,需要添加 mapper.xml文件(当然可以通过自动生成,这里说的是不自动生成的情况下),没有固定的模板,在工具中自己添加模板。
1:打开 window–>Preferences–>xml–>xml files–>templates–>new
2:new
<?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="***Mapper" >
</mapper>
3:使用
在mapper.xml文件中,alt+/提示,选择mapper。