第一步安装eclipse插件
第二步,配置文件如下
<?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" >
<!-- 使用eclipse安装generator插件自动隐射,减少代码出错率,并严格遵循SUN公司的java代码规范 -->
<generatorConfiguration>
<!-- mySql数据库连接jar -->
<classPathEntry
location="D:/apache-tomcat-6.0.44_sso/lib/mysql-connector-java-5.0.8-bin.jar" />
<context id="context1">
<commentGenerator>
<property name="suppressDate" value="true" />
<property name="suppressAllComments" value="true" />
</commentGenerator>
<!-- mySql数据库连接地址,用户名,密码 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://192.168.31.184:3306/gjmj_product" userId="root"
password="gjmj" />
<javaModelGenerator targetPackage="com.gjmj.mybatisMapper.entity"
targetProject="mybatisMapper" />
<sqlMapGenerator targetPackage="com.gjmj.mybatisMapper.mapper"
targetProject="mybatisMapper" />
<javaClientGenerator targetPackage="com.gjmj.mybatisMapper.client"
targetProject="mybatisMapper" type="XMLMAPPER" />
<!-- 需要ORM映射的表和对应的实体名 -->
<table tableName="t_assemble_package" domainObjectName="AssemblePackage"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="t_assemble_packagen" domainObjectName="AssemblePackagen"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="t_base_att_type_classify" domainObjectName="BaseAttTypeClassify"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="t_base_attribute" domainObjectName="BaseAttribute"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="t_base_attribute_mould" domainObjectName="BaseAttributeMould"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="t_base_attribute_type" domainObjectName="BaseAttributeType"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="t_base_brand" domainObjectName="BaseBrand"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="t_base_classify" domainObjectName="BaseClassify"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="t_base_classify_brand" domainObjectName="BaseClassifyBrand"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="t_base_mould_attribute" domainObjectName="BaseMouldAttribute"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="t_base_mould_query" domainObjectName="BaseMouldQuery"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="t_base_pro_spec" domainObjectName="BaseProSpec"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="t_base_query_price" domainObjectName="BaseQueryPrice"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="t_hom_distribution" domainObjectName="HomDistribution"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="t_hom_pro_attribute" domainObjectName="HomProAttribute"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="t_hom_pro_custom_att" domainObjectName="HomProCustomAtt"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="t_hom_pro_dis_area" domainObjectName="HomProDisArea"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
</context>
</generatorConfiguration>
本文出自 “夜鹰翱翔” 博客,请务必保留此出处http://iritchie.blog.51cto.com/7031731/1668954
原文地址:http://iritchie.blog.51cto.com/7031731/1668954