MyBatis代码逆向生成笔记(个人笔记)

generatorConfig.xml配置文件




<generatorConfiguration>
    <classPathEntry
            location="D:\Chrome download\apache-maven-3.6.3\localRepository\mysql\mysql-connector-java\5.1.29\mysql-connector-java-5.1.29.jar"/>


    <context id="testTables" targetRuntime="MyBatis3">
        <commentGenerator>
            
            <property name="suppressAllComments" value="true"/>
        commentGenerator>
        
        <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                        connectionURL="jdbc:mysql:///tmall_ssm" userId="root"
                        password="962464">
        jdbcConnection>
        
        <javaTypeResolver>
            <property name="forceBigDecimals" value="false"/>
        javaTypeResolver>

        
        <javaModelGenerator targetPackage="com.lp.domain"
                            targetProject=".\src\main\java">
            
            <property name="enableSubPackages" value="false"/>
            
            <property name="trimStrings" value="true"/>
        javaModelGenerator>
        
        <sqlMapGenerator targetPackage="com\lp\dao"
                         targetProject=".\src\main\resources">
            
            <property name="enableSubPackages" value="false"/>
        sqlMapGenerator>
        
        <javaClientGenerator type="XMLMAPPER"
                             targetPackage="com.lp.dao"
                             targetProject=".\src\main\java">
            
            <property name="enableSubPackages" value="false"/>
        javaClientGenerator>
        
        <table schema="" tableName="category">table>
        <table schema="" tableName="order_">table>
        <table schema="" tableName="order_item">table>
        <table schema="" tableName="product">table>
        <table schema="" tableName="product_image">table>
        <table schema="" tableName="property">table>
        <table schema="" tableName="property_value">table>
        <table schema="" tableName="referal_link">table>
        <table schema="" tableName="review">table>
        <table schema="" tableName="user">table>


        


    context>
generatorConfiguration>

pom.xml所需依赖

 
    <build>
        <plugins>
            <plugin>
                <groupId>org.mybatis.generatorgroupId>
                <artifactId>mybatis-generator-maven-pluginartifactId>
                <version>1.3.5version>
                <configuration>
                    <verbose>trueverbose>
                    <overwrite>trueoverwrite>
                configuration>
            plugin>
        plugins>
    build>

MyBatis代码逆向生成笔记(个人笔记)_第1张图片

你可能感兴趣的:(Java分享)