如何让idea自动创建mybatis配置文件?
一、在pom.xml中添加plugin
其中generatorConfig.xml的位置,大家根据实际情况自行调整
二、generatorConfig.xml配置文件
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE generatorConfiguration
3 PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
4 "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
5 <generatorConfiguration>
6 <classPathEntry
7 location="C:/Oracle/Middleware/wlserver_10.3/server/lib/ojdbc6.jar"/>
8 <context id="my" targetRuntime="MyBatis3">
9 <commentGenerator>
10 <property name="suppressDate" value="false"/>
11 <property name="suppressAllComments" value="true"/>
12 </commentGenerator>
13 <jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"
14 connectionURL="jdbc:oracle:thin:@172.20.16.***:1521:CARGO" userId="***"
15 password="***"/>
16 <javaModelGenerator targetPackage="ctas.test.entity"
17 targetProject="D:/yangjm/Code/CTAS/JAVAEE/CTAS2CCSP/src/main/java">
18 <property name="enableSubPackages" value="true"/>
19 <property name="trimStrings" value="true"/>
20 </javaModelGenerator>
21 <sqlMapGenerator targetPackage="ctas.test.entity.xml"
22 targetProject="D:/yangjm/Code/CTAS/JAVAEE/CTAS2CCSP/src/main/java">
23 <property name="enableSubPackages" value="true"/>
24 </sqlMapGenerator>
25 <javaClientGenerator targetPackage="ctas.test.mapper"
26 targetProject="D:/yangjm/Code/CTAS/JAVAEE/CTAS2CCSP/src/main/java" type="XMLMAPPER">
27 <property name="enableSubPackages" value="true"/>
28 </javaClientGenerator>
29 <!--<table tableName="T_FEE_AGTBILL" domainObjectName="FeeAgentBill"
30 enableCountByExample="false" enableUpdateByExample="false"
31 enableDeleteByExample="false" enableSelectByExample="false"
32 selectByExampleQueryId="false"/>-->
33 <table tableName="CTAS_FEE_BASE" domainObjectName="FeeBase"
34 enableCountByExample="false" enableUpdateByExample="false"
35 enableDeleteByExample="false" enableSelectByExample="false"
36 selectByExampleQueryId="false">
37 <!--<columnRenamingRule searchString="^D_"
38 replaceString=""/>-->
39 </table>
40 </context>
41 </generatorConfiguration>
根据具体问题类型,进行步骤拆解/原因原理分析/内容拓展等。
具体步骤如下:/导致这种情况的原因主要是……