idea创建mybatis的config.xml和mapper.xml方法_xml

 

idea创建mybatis的config.xml和mapper.xml方法_xml_02  1、file—setting,左上角输入template, 
2、在左侧栏找到File And Code Templates 
3、中间选中Files 
4、点击+号,添加模板 
5、输入模板名字:Name:mybatis-mapper.xml (name可以自定义) 
6、后缀名extension:xml 
7、在面板中间输入内容:

<?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>

  8.把enable live Template(激活模板)勾选上 

 9.点击Apply—ok 

 

根据以上步骤配置config.xml即可.

idea创建mybatis的config.xml和mapper.xml方法_自定义_03

 

 配置完毕后, 即可新建对应的xml文件

idea创建mybatis的config.xml和mapper.xml方法_干货_04

 

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd" >
<configuration>
    
    
</configuration>