generator.xml

<?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>
<context id="DB2Tables" targetRuntime="MyBatis3">
<commentGenerator>
<property name="suppressDate" value="true"/>
<!-- 是否去除自动生成的注释 true:是 : false:否 -->
<property name="suppressAllComments" value="true"/>
</commentGenerator>

<!--数据库连接参数 -->
<jdbcConnection
driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/xiaomi"
userId="root"
password="root">
</jdbcConnection>

<javaTypeResolver>
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>

<!-- 实体类的包名和存放路径 -->
<javaModelGenerator targetPackage="entry" targetProject="src/main/java">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>

<!-- 生成映射文件*.xml的位置-->
<sqlMapGenerator targetPackage="mapper" targetProject="src/main/resources">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>

<!-- 生成DAO的包名和位置 -->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.xiaomi.dao" targetProject="src/main/java">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>

<!-- tableName:数据库中的表名或视图名;domainObjectName:生成的实体类的类名-->
<table tableName="consumer" domainObjectName="Consumer"></table>
<table tableName="goods" domainObjectName="Goods"></table>
<table tableName="goods_images" domainObjectName="GoodsImages"></table>
<table tableName="goods_type" domainObjectName="GoodsType"></table>
<table tableName="goods_service" domainObjectName="GoodsService"></table>
<table tableName="goods_package" domainObjectName="GoodsPackage"></table>
<table tableName="goods_configure" domainObjectName="GoodsConfigure"></table>
<table tableName="goods_cart" domainObjectName="GoodsCart"></table>
<table tableName="goods_order" domainObjectName="GoodsOrder"></table>
<table tableName="goods_order_item" domainObjectName="GoodsOrderItem"></table>
<table tableName="goods_shipping_address" domainObjectName="GoodsShippingAddress"></table>
</context>
</generatorConfiguration>
posted @ 2022-07-23 17:00  谢远栋  阅读(118)  评论(0)    收藏  举报