问答详情
源自:2-2 引入SpringBoot依赖包实现简单的WEB项目

创建的跟老师的不一样

安装老师说的创建了之后,没有src,又创建了一个,没有点quickstart,src出来了,然后pom里面的代码就很少,我安装老师的复制进去还报错了,咋回事?求教


提问者:_牧渊 2020-01-10 15:20

个回答

  • _牧渊
    2020-01-10 20:14:59

    http://img3.mukewang.com/5e186a920001c69b08430527.jpg

    我这里没有你说的那个mybatis-generator.xml配置文件,不知道在哪里,第一次学这个spring

  • 青椒盖饭
    2020-01-10 16:28:49


    看下mybatis-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>
        <classPathEntry location="E:\3.dev-workspace\2.maven\mysql\mysql-connector-java\5.1.34\mysql-connector-java-5.1.34.jar" />
    
        <context id="DB2Tables" targetRuntime="MyBatis3">
            <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                            connectionURL="jdbc:mysql://127.0.0.1:3306/miaosha"
                            userId="root"
                            password="root">
            </jdbcConnection>
    
            <javaTypeResolver >
                <property name="forceBigDecimals" value="false" />
            </javaTypeResolver>
    
            <javaModelGenerator targetPackage="com.miaoshaproject.dataobject" targetProject="src/main/java">
                <property name="enableSubPackages" value="true" />
                <property name="trimStrings" value="true" />
            </javaModelGenerator>
    
            <sqlMapGenerator targetPackage="mapping"  targetProject="src\main\resources">
                <property name="enableSubPackages" value="true" />
            </sqlMapGenerator>
    
            <javaClientGenerator type="XMLMAPPER" targetPackage="com.miaoshaproject.dao"  targetProject="src\main\java">
                <property name="enableSubPackages" value="true" />
            </javaClientGenerator>
    
            <table  tableName="user_info" domainObjectName="UserDo"
                    enableCountByExample="false"
                    enableUpdateByExample="false"
                    enableDeleteByExample="false"
                    enableSelectByExample="false"
            selectByExampleQueryId="false"></table>
            <table  tableName="user_password" domainObjectName="UserPasswordDo"
                    enableCountByExample="false"
                    enableUpdateByExample="false"
                    enableDeleteByExample="false"
                    enableSelectByExample="false"
                    selectByExampleQueryId="false"></table>
        </context>
    </generatorConfiguration>