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文件的添加。
本文介绍了如何在macOS环境下,使用IntelliJ IDEA创建Mapper.xml文件的步骤。首先,通过Preference设置,进入Editor的File and Code Templates,然后添加新模板,命名为Mapper,扩展名为xml。接着,输入mapper.xml的基本结构,包括XML声明和Mapper的namespace。最后,保存设置,即可完成Mapper.xml文件的定制。

335

被折叠的 条评论
为什么被折叠?



