1.下載mybatis generator插件:https://dl.bintray.com/mybatis/mybatis-generator/zipped/
2. 解壓zip包,並將其中的features和plugin放到eclipse的dropins下
3. 重啟eclipse,右鍵New--》other 出現如下選項則證明安裝成功
4. 新建一個名為test的Dynamic Web Project項目,引入Oracle數據庫驅動jar包:ojdbc14.jar
5.在項目名稱上右鍵—》new—》MyBatis Generator Configuration File,生成如下配置文件:
6.對generatorConfig.xml 進行配置
7. 生成代碼
在generatorConfig.xml上右鍵—》Run As—》Run Mybatis Generator,生成相應代碼
可詳見 Idea使用Mybatis Generator 自動生成代碼 , generatorConfig.xml 配置文件創建與配置是相同的, 只是安裝配置插件, 運行方式不同