write
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration PUBLIC "-////DTD MyBatis Generator Configuration 1.0//EN" "/dtd/mybatis-generator-config_1_0.dtd"> <generatorConfiguration> <properties resource=""/> <context targetRuntime="MyBatis3" defaultModelType="flat"> <property name="beginningDelimiter" value="`"/> <property name="endingDelimiter" value="`"/> <property name="javaFileEncoding" value="UTF-8"/> <!-- Generate serialization methods for the model--> <plugin type=""/> <!-- For generatedJavaCreate a modeltoStringmethod --> <plugin type=""/> <!--Overwrite the original file during generation--> <plugin type="" /> <!--Configure database connections--> <jdbcConnection driverClass="${}" connectionURL="${}" userId="${}" password="${}"> </jdbcConnection> <!--Specify the generationmodelThe path--> <javaModelGenerator targetPackage="" targetProject="src/main/java"/> <!--Specify the generationThe path--> <sqlMapGenerator targetPackage="" targetProject="src/main/resources"/> <!--Specify the generationmapper接口的The path--> <javaClientGenerator type="XMLMAPPER" targetPackage="" targetProject="src/main/java"/> <!--Generate all tablestableNameSet as%--> <table tableName="user"> <generatedKey column="id" sqlStatement="MySql" identity="true"/> </table> </context> </generatorConfiguration>
Introduce dependencies
<!-- MyBatis Generator --> <dependency> <groupId></groupId> <artifactId>mybatis-generator-core</artifactId> <!--The dependency version must be in1.3.5above--> <version>1.3.7</version> </dependency>
This is the article about the Mybatis generator mapper file covering the original file. For more related contents of Mybatis generator mapper files, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!