码迷,mamicode.com
首页 > 数据库 > 详细

mybatis3数据库自动化映射配置文件

时间:2015-06-29 18:04:44      阅读:634      评论:0      收藏:0      [点我收藏+]

标签:配置文件   数据库   

第一步安装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

mybatis3数据库自动化映射配置文件

标签:配置文件   数据库   

原文地址:http://iritchie.blog.51cto.com/7031731/1668954

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!