macOS中使用idea创建mapper.xml文件
首先点击:Intellij IDEA—>Preferences…,或者直接使用快捷键command+,
然后:Editor–>File and Code Templates–>File下的➕号,出现如图所示,再对创建的文件命名(Name)以及文件的扩展类型(Extension)。
此处是创建的Mapper.xml,所以Name:Mapper,Extension:xml
下面展示内容为 mapper.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="">
</mapper>
最后,apply–>ok,就完成了对mapper.xml文件的添加。