配置
mybatis-generator.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
<generatorConfiguration>
<!-- 一个数据库一个context -->
<context id="DB2Tables" targetRuntime="Mybatis3">
<!-- jdbc连接 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3306/miaosha" userId="root"
password="123456" />
<!-- 生成DataObject类地址 -->
<javaModelGenerator targetPackage="com.NEU.dataobject"
targetProject="src/main/java" >
<!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
<property name="enableSubPackages" value="true"/>
<!-- 是否针对string类型的字段在set的时候进行trim调用 -->
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<!-- 生成mapxml文件 -->
<sqlMapGenerator targetPackage="mapping"
targetProject="src/main/resources" >
<!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<!-- 生成mapxml对应client,也就是接口dao -->
<javaClientGenerator targetPackage="com.NEU.dao"
targetProject="src/main/java" type="XMLMAPPER" >
<!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
<property name="enableSubPackages" value="true" />
</javaClientGenerator>
<!-- 配置表信息 -->
<!--<table tableName="user_info" domainObjectName="UserDO"-->
<!--enableCountByExample="false"-->
<!--enableUpdateByExample="false"-->
<!--enableDeleteByExample="false"-->
<!--enableSelectByExample="false"-->
<!--selectByExampleQueryId="false"></table>-->
<!--<table tableName="user_password" domainObjectName="UserPasswordDO"-->
<!--enableCountByExample="false"-->
<!--enableUpdateByExample="false"-->
<!--enableDeleteByExample="false"-->
<!--enableSelectByExample="false"-->
<!--selectByExampleQueryId="false"></table>-->
<!--<table tableName="item" domainObjectName="ItemDO"-->
<!--enableCountByExample="false"-->
<!--enableUpdateByExample="false"-->
<!--enableDeleteByExample="false"-->
<!--enableSelectByExample="false"-->
<!--selectByExampleQueryId="false"></table>-->
<!--<table tableName="item_stock" domainObjectName="ItemStockDO"-->
<!--enableCountByExample="false"-->
<!--enableUpdateByExample="false"-->
<!--enableDeleteByExample="false"-->
<!--enableSelectByExample="false"-->
<!--selectByExampleQueryId="false"></table>-->
<!--<table tableName="order_info" domainObjectName="OrderDO"-->
<!--enableCountByExample="false"-->
<!--enableUpdateByExample="false"-->
<!--enableDeleteByExample="false"-->
<!--enableSelectByExample="false"-->
<!--selectByExampleQueryId="false"></table>-->
<!--<table tableName="sequence_info" domainObjectName="SequenceDO"-->
<!--enableCountByExample="false"-->
<!--enableUpdateByExample="false"-->
<!--enableDeleteByExample="false"-->
<!--enableSelectByExample="false"-->
<!--selectByExampleQueryId="false"></table>-->
<table tableName="user_info" domainObjectName="UserDO"></table>
<table tableName="user_password" domainObjectName="UserPasswordDO"></table>
</context>
</generatorConfiguration>
解决思路:
参考:https://blog.youkuaiyun.com/weixin_46544994/article/details/106940070
下载 https://github.com/mfriedenhagen/dummy-lifecycle-mapping-plugin
2、解压dummy-lifecycle-mapping-plugin.zip文件,在IDEA中点击File>>OPENT 打开这个目录下pom文件,选择一文件的方式打开,
在打开的pom文件右键open in terminal 在命令窗口执行执行mvn clean install 回车执行即可。
但是build遇到了问题,就是Error:java: 不再支持源选项 5。请使用 7或更高版本。
pom文件中添加:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<java.version>11</java.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
解决