Mybatis 是一款優秀的 ORM 框架,但是在 IDEA 工具使用時並未自帶 MAPPER 文件模板,需要手工添加,接下來就一起在 IDEA 中創建一個 MAPPER 文件模板吧;
1、打開 IDEA ,右鍵 new-->Edit File Template
2、點擊 + ,輸入此模板名稱
3、黏貼 MAPPER 模板內容:
<?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>