IDEA mybatis using reverse engineering

1, create a Maven project

Add 2, POM file dependent

  < Properties > 
    < project.build.sourceEncoding > UTF-. 8 </ project.build.sourceEncoding > 
    < maven.compiler.source > 1.7 </ maven.compiler.source > 
    < maven.compiler.target > 1.7 </ maven.compiler .target > 
  </ Properties > 

  <-! this dependency is to avoid the error generation Mapper interfaces, the resource does not affect the generation process -> 
  < Dependencies > 
    < dependency > 
      < the groupId > org.mybatis </groupId>
      < ArtifactId > the mybatis </ artifactId > 
      < Version > 3.2.8 </ Version > 
    </ dependency > 
  </ the Dependencies > 

  <-! Configure reverse engineering Maven plugins -> 
  < Build > 
    <-! Plugins: build process used in plug-in -> 
    < plugins > 
      <-! plugin: specific plug -> 
      < plugin > 
        <-! MyBatis reverse engineering plug-in coordinates -> 
        < groupId > org.mybatis.generator </groupId> 
        < The artifactId > MyBatis-Generator-Maven-plugin </ the artifactId > 
        < Version > 1.3.0 </ Version > 

        <-! Widget used during operation depends -> 
        < Dependencies > 
          < dependency > 
            < the groupId > ORG .mybatis.generator </ the groupId > 
            < the artifactId > MyBatis-Generator-Core </ the artifactId > 
            < Version > 1.3.2 </ Version >
          </dependency>
          <dependency>
            <groupId>com.mchange</groupId>
            <artifactId>c3p0</artifactId>
            <version>0.9.2</version>
          </dependency>
          <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.8</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

3. Add a Run Configuration

4, you can click RUN

Guess you like

Origin www.cnblogs.com/hucheng1997/p/11204386.html