美文网首页
IntelliJ Idea自定义mybatis xml模版

IntelliJ Idea自定义mybatis xml模版

作者: 洪兴掌管一代 | 来源:发表于2021-10-17 20:56 被阅读0次

设置中新建并配置xml模版:

1.点击File and Code Templates

2.点击+

3.输入模版名字

4.输入模版的文件扩展名

5.输入自动生成的模版内容

6.勾选Enable Live Templates

7.apply

idea截图

附上一份mybatis 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="">

<!-- type of resultMap usually is a model customized by developer. -->              

<resultMap id="" type="">

        <!-- jdbcType of result is a data type of database. -->

        <result column="" property="" jdbcType=""/>

    </resultMap>

    <!-- parameterType of select can be a customized model or a primitive type. -->

    <select id="" parameterType="" resultMap=""> </select>

    <insert id="" keyProperty="" parameterType="" useGeneratedKeys="true"> </insert>

    <update id="" parameterType=""> </update>

    <delete id="" parameterType=""> </delete>

</mapper>

然后去文件夹创建即可:

相关文章

网友评论

      本文标题:IntelliJ Idea自定义mybatis xml模版

      本文链接:https://www.haomeiwen.com/subject/sttioltx.html