久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術文章
文章詳情頁

IDEA集成MyBatis Generator插件的使用

瀏覽:131日期:2024-08-24 14:57:14

1、修改maven的pom文件

只需要將如下依賴添加到pom.xml文件中即可。(注意此處是以plugin的方式,放在<plugins> </plugins>中間即可)

<plugin> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-maven-plugin</artifactId> <version>1.3.2</version></plugin>

2、編寫generatorConfig.xml

需要特別注意的是:在IDEA開發(fā)環(huán)境下,這個文件需要放置在resources的根目錄下面

文件內(nèi)容如下

<?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> <!-- 數(shù)據(jù)庫驅動:選擇你的本地硬盤上面的數(shù)據(jù)庫驅動包--> <classPathEntry location='C:UsersAdministrator.DataGrip2017.3configjdbc-driversMySQL ConnectorJ5.1.45mysql-connector-java-5.1.45-bin.jar'/> <context targetRuntime='MyBatis3'> <commentGenerator> <property name='suppressDate' value='true'/> <!-- 是否去除自動生成的注釋 true:是 : false:否 --> <property name='suppressAllComments' value='true'/> </commentGenerator> <!--數(shù)據(jù)庫鏈接URL,用戶名、密碼 --> <jdbcConnection driverClass='com.mysql.jdbc.Driver' connectionURL='jdbc:mysql://127.0.0.1/mysdql' userId='root' password='root'> </jdbcConnection> <javaTypeResolver> <property name='forceBigDecimals' value='false'/> </javaTypeResolver> <!-- 生成模型的包名和位置--> <javaModelGenerator targetPackage='com.yingjun.ssm.entity' targetProject='src/main/java'> <property name='enableSubPackages' value='true'/> <property name='trimStrings' value='true'/> </javaModelGenerator> <!-- 生成映射文件的包名和位置--> <sqlMapGenerator targetPackage='mapper' targetProject='src/main/resources'> <property name='enableSubPackages' value='true'/> </sqlMapGenerator> <!-- 生成DAO的包名和位置--> <javaClientGenerator type='XMLMAPPER' targetPackage='com.yingjun.ssm.dao' targetProject='src/main/java'> <property name='enableSubPackages' value='true'/> </javaClientGenerator> <!-- 要生成的表 tableName是數(shù)據(jù)庫中的表名或視圖名 domainObjectName是實體類名--> <table tableName='t_activity' domainObjectName='Activity' enableCountByExample='false' enableUpdateByExample='false' enableDeleteByExample='false' enableSelectByExample='false' selectByExampleQueryId='false'></table> </context></generatorConfiguration>

文件的位置如下

IDEA集成MyBatis Generator插件的使用

3、創(chuàng)建maven運行項

IDEA集成MyBatis Generator插件的使用

IDEA集成MyBatis Generator插件的使用

IDEA集成MyBatis Generator插件的使用

IDEA集成MyBatis Generator插件的使用

到此這篇關于IDEA集成MyBatis Generator插件的使用的文章就介紹到這了,更多相關IDEA集成MyBatis Generator 內(nèi)容請搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持好吧啦網(wǎng)!

標簽: IDEA
相關文章:
主站蜘蛛池模板: 乳源| 图木舒克市| 黄平县| 那坡县| 无锡市| 湖州市| 瑞安市| 江陵县| 利辛县| 离岛区| 望城县| 新丰县| 东至县| 皮山县| 浪卡子县| 万盛区| 永城市| 探索| 荔波县| 蒙阴县| 松桃| 安吉县| 郁南县| 大厂| 涟水县| 白玉县| 和静县| 苏州市| 新乡市| 略阳县| 鸡泽县| 崇文区| 庄河市| 萝北县| 唐山市| 土默特右旗| 阜城县| 亚东县| 马山县| 四平市| 正镶白旗|