mysql generator代码生成器生成多一个包是怎么回事
1个回答
展开全部
一、在pom.xml中添加plugin
View Code
其中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
6 <generatorConfiguration>
7 <classPathEntry
8 location="C:/Oracle/Middleware/wlserver_10.3/server/lib/ojdbc6.jar"/>
9 <context id="my" targetRuntime="MyBatis3">
10 <commentGenerator>
11 <property name="suppressDate" value="false"/>
12 <property name="suppressAllComments" value="true"/>
13 </commentGenerator>
14
15 <jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"
16 connectionURL="jdbc:oracle:thin:@172.20.16.***:1521:CARGO" userId="***"
17 password="***"/>
18
19 <javaModelGenerator targetPackage="ctas.test.entity"
20 targetProject="D:/yangjm/Code/CTAS/JAVAEE/CTAS2CCSP/src/main/java">
21 <property name="enableSubPackages" value="true"/>
22 <property name="trimStrings" value="true"/>
23 </javaModelGenerator>
24
25 <sqlMapGenerator targetPackage="ctas.test.entity.xml"
26 targetProject="D:/yangjm/Code/CTAS/JAVAEE/CTAS2CCSP/src/main/java">
27 <property name="enableSubPackages" value="true"/>
28 </sqlMapGenerator>
29
30 <javaClientGenerator targetPackage="ctas.test.mapper"
31 targetProject="D:/yangjm/Code/CTAS/JAVAEE/CTAS2CCSP/src/main/java" type="XMLMAPPER">
32 <property name="enableSubPackages" value="true"/>
33 </javaClientGenerator>
34
35 <!--<table tableName="T_FEE_AGTBILL" domainObjectName="FeeAgentBill"
36 enableCountByExample="false" enableUpdateByExample="false"
37 enableDeleteByExample="false" enableSelectByExample="false"
38 selectByExampleQueryId="false"/>-->
39
40 <table tableName="CTAS_FEE_BASE" domainObjectName="FeeBase"
41 enableCountByExample="false" enableUpdateByExample="false"
42 enableDeleteByExample="false" enableSelectByExample="false"
43 selectByExampleQueryId="false">
44 <!--<columnRenamingRule searchString="^D_"
45 replaceString=""/>-->
46 </table>
47
48 </context>
49 </generatorConfiguration>
View Code
其中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
6 <generatorConfiguration>
7 <classPathEntry
8 location="C:/Oracle/Middleware/wlserver_10.3/server/lib/ojdbc6.jar"/>
9 <context id="my" targetRuntime="MyBatis3">
10 <commentGenerator>
11 <property name="suppressDate" value="false"/>
12 <property name="suppressAllComments" value="true"/>
13 </commentGenerator>
14
15 <jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"
16 connectionURL="jdbc:oracle:thin:@172.20.16.***:1521:CARGO" userId="***"
17 password="***"/>
18
19 <javaModelGenerator targetPackage="ctas.test.entity"
20 targetProject="D:/yangjm/Code/CTAS/JAVAEE/CTAS2CCSP/src/main/java">
21 <property name="enableSubPackages" value="true"/>
22 <property name="trimStrings" value="true"/>
23 </javaModelGenerator>
24
25 <sqlMapGenerator targetPackage="ctas.test.entity.xml"
26 targetProject="D:/yangjm/Code/CTAS/JAVAEE/CTAS2CCSP/src/main/java">
27 <property name="enableSubPackages" value="true"/>
28 </sqlMapGenerator>
29
30 <javaClientGenerator targetPackage="ctas.test.mapper"
31 targetProject="D:/yangjm/Code/CTAS/JAVAEE/CTAS2CCSP/src/main/java" type="XMLMAPPER">
32 <property name="enableSubPackages" value="true"/>
33 </javaClientGenerator>
34
35 <!--<table tableName="T_FEE_AGTBILL" domainObjectName="FeeAgentBill"
36 enableCountByExample="false" enableUpdateByExample="false"
37 enableDeleteByExample="false" enableSelectByExample="false"
38 selectByExampleQueryId="false"/>-->
39
40 <table tableName="CTAS_FEE_BASE" domainObjectName="FeeBase"
41 enableCountByExample="false" enableUpdateByExample="false"
42 enableDeleteByExample="false" enableSelectByExample="false"
43 selectByExampleQueryId="false">
44 <!--<columnRenamingRule searchString="^D_"
45 replaceString=""/>-->
46 </table>
47
48 </context>
49 </generatorConfiguration>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询