mybatis generator 配置 反向生成Entity简单增删改查实例代码如下所示:
<"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> <> <classPathEntry location="D:.m2repositorymysqlmysql-connector-java5.1.38mysql-connector-java-5.1.38.jar" /> <context id="DB2Tables" targetRuntime="MyBatis3"> <> <commentGenerator> <property name="suppressAllComments" value="true" /> </commentGenerator> <> <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://192.168.5.159:3306/数据库名称" userId="用户名" password="你懂得"> </jdbcConnection> <> <javaTypeResolver> <property name="forceBigDecimals" value="false" /> </javaTypeResolver> <> <javaModelGenerator targetPackage="com.heaboy.包名.base.entity" targetProject="项目名"> <property name="enableSubPackages" value="false" /> <property name="trimStrings" value="true" /> </javaModelGenerator> <> <sqlMapGenerator targetPackage="com.heaboy.包名.mybatis" targetProject="项目名"> <property name="enableSubPackages" value="false" /> </sqlMapGenerator> <> <javaClientGenerator type="XMLMAPPER" targetPackage="com.heaboy.包名.base.dao" targetProject="项目名"> <property name="enableSubPackages" value="false" /> </javaClientGenerator> <> <table tableName="表名" domainObjectName="生成的实体名" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" delimitIdentifiers="true"> <property name="useActualColumnNames" value="true" /> </table> <table tableName="表名2" domainObjectName="生成的实体名2" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"> <property name="useActualColumnNames" value="true" /> </table> </context> </generatorConfiguration>
以上所述是小编给大家介绍的mybatis generator 配置 反向生成Entity简单增删改查,希望对大家有所帮助,如果大家有任何疑问请给我们留言,小编会及时回复大家的。在此也非常感谢大家对查字典教程网的支持!