mybatis-generator生成数据库对应表的单表增删改查,比较方便。直接上代码:
<?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>
<!--˽ߝࠢȽ֯-->
<classPathEntry location="mysql-connector-java-5.1.45-bin.jar"/>
<context id="DB2Tables" targetRuntime="MyBatis3">
<commentGenerator>
<property name="suppressDate" value="true"/>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<!--˽ߝࠢtޓַ֘ۅĜë-->
<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://192.168.1.110:3306/sb" userId="root" password="Root1234.">
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>
<!--ʺԉModel`զλ׃-->
<javaModelGenerator targetPackage="cq.model" targetProject="src">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<!--ʺԉӳʤτݾզλ׃-->
<sqlMapGenerator targetPackage="cq.mapping" targetProject="src">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<!--ʺԉDao`զλ׃-->
<javaClientGenerator type="XMLMAPPER" targetPackage="cq.dao" targetProject="src">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!--ʺԉהӦҭܰ`Ļ-->
<table tableName="SB" domainObjectName="SB" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
</context>
</generatorConfiguration>
所以文件都在我的资源里,下载即可使用:https://download.csdn.net/download/goodlook0123/10541334