Idea 使用Mybatis逆向工程操作步驟
阿新 • • 發佈:2018-12-30
初步接觸IDEA,還不熟悉相關的操作,記錄一下IDEA使用Mybatis逆向工程操作步驟
1.引入JAR包:mybatis-generator-core
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.6</version>
</dependency>
2.加入配置檔案MBG.xml檔案到resources資料夾下,需要注意檔案中的配置3.配置pom
<plugin> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-maven-plugin</artifactId> <version>1.3.6</version> <configuration> <configurationFile>src/main/resources/MBG.xml</configurationFile> <verbose>true</verbose> <overwrite>true</overwrite> </configuration> </plugin>
4.Run/Debug Configurations配置
>點選
>點選選擇Maven
>配置相關資訊,輸入命令列
5. 選中剛剛配置的選項,點選執行就能看到生成了對應的mapper檔案和bean檔案,然後就可以去進行增刪改查了