eclipse中添加mybatis的xml模板

在项目开发中,使用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。
在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/m0_37392489/article/details/85114483