So first of all, I’m going to show you the successful state of the operation and you’ll see the Model and the Mapper on the left

In POM.xml, write the dependencies first Since it is the integration of Mybatis must be used database related dependencies here is Mysql dependency and Mybatis dependency The process is to double-click the plugin to run the generatorMapper.xml configuration you configured in the POM and then load the generatorMapper.xml configuration I won’t give you the specific code because everyone’s path package path and so on information is different you took mine is almost all changed to increase your impression

The last step is to note that the mysql driver package path must be in English

<? 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> <! -- Specify the location of the JDBC driver package to connect to the database. Be sure to specify the full path to your host --> <classPathEntry location="E: \ Data \ mysql connector - Java - 5.1.48. Jar"/ > <! -- Configure the table information body targetRuntime to use MyBatis3 version --> <context ID ="tables" targetRuntime="MyBatis3"> <! Since the generated comments are in English, it is possible to disallow them to generate --> <commentGenerator> <property name="suppressAllComments" value="true"/> </commentGenerator> <! -- configure database connection information --> <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                        connectionURL="jdbc:mysql://localhost:3306/car"
                        userId="root"
                        password="198073LTH"> </jdbcConnection> <! <javaModelGenerator targetPackage=? <javaModelGenerator targetPackage="com.aolang.spring.web.model"
                            targetProject="src/main/java">
            <property name="enableSubPackages" value="false"/>
            <property name="trimStrings" value="false"/> </javaModelGenerator> <! The mapper. XML file generated by mabatis points to the path where the second generated file is placed --> <sqlMapGenerator targetPackage="com.aolang.spring.web.mapper"
                         targetProject="src/main/java">
            <property name="enableSubPackages" value="false"/> </sqlMapGenerator> <! < javaclientType =? < javaclientType ="XMLMAPPER"
                             targetPackage="com.aolang.spring.web.mapper"
                             targetProject="src/main/java">
            <property name="enableSubPackages" value="false"/> </javaClientGenerator> <! --> <table tableName="student" domainObjectName="student"
                enableCountByExample="false"
                enableUpdateByExample="false"
                enableDeleteByExample="false"
                enableSelectByExample="false"
                selectByExampleQueryId="false"/>
    </context>
</generatorConfiguration>
Copy the code