当前位置: 首页 > wzjs >正文

广州平台网站建设seo营销策划

广州平台网站建设,seo营销策划,兰州seo整站优化服务商,企业网站建设方法1、生成数据库数据 2、配置pom文件 这个plugin文件里有配置项和依赖以及版本号 修改configurationFile路径为项目里存在的generatorConfig.xml文件&#xff0c;因为后续的配置都在这个文件中进行。 <plugin><groupId>org.mybatis.generator</groupId><…

1、生成数据库数据

2、配置pom文件

这个plugin文件里有配置项和依赖以及版本号

修改configurationFile路径为项目里存在的generatorConfig.xml文件,因为后续的配置都在这个文件中进行。

<plugin><groupId>org.mybatis.generator</groupId><artifactId>mybatis-generator-maven-plugin</artifactId><version>1.3.7</version><configuration><configurationFile>E:\Java\java初阶学习\JavaCode\java-learning\others\MybatisPlusTest\src\main\resources\generator\generatorConfig.xml</configurationFile><overwrite>true</overwrite><verbose>true</verbose></configuration><dependencies><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.6</version></dependency></dependencies></plugin>

3、配置generatorConfig.xml文件

这里面有几个地方需要自己进行修改。

  • 驱动包的路径,要配置成自己电脑里的连接数据库的驱动包
  • 连接配置,需要自己输入数据库的id和密码
  • 实体类生成的位置:需要在指定的目录下创包
  • mapper.xml生成的位置:需要在指定的目录下创包
  • DAO生成的位置:需要在指定的目录下创包
  • 配置数据库中的表,table_name是数据库中表的名字,domainObjectName是对应的java中对象的名字(需修改或新建)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfigurationPUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN""http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration><!-- 驱动包路径,location中路径替换成⾃⼰本地路径 --><classPathEntry location="C:\environment\mysql-connector-java-5.1.49"/><context id="DB2Tables" targetRuntime="MyBatis3"><!-- 禁⽤⾃动⽣成的注释 --><commentGenerator><property name="suppressAllComments" value="true"/><property name="suppressDate" value="true"/></commentGenerator><!-- 连接配置 --><jdbcConnection driverClass="com.mysql.jdbc.Driver"connectionURL="jdbc:mysql://127.0.0.1:3306/forum_db?characterEncoding=utf8&amp;useSSL=false"userId="root"password=""></jdbcConnection><javaTypeResolver><!-- ⼩数统⼀转为BigDecimal --><property name="forceBigDecimals" value="false"/></javaTypeResolver><!-- 实体类⽣成位置 --><javaModelGenerator targetPackage="com.example.mybatisplustest.model"targetProject="src/main/java"><property name="enableSubPackages" value="true"/><property name="trimStrings" value="true"/></javaModelGenerator><!-- mapper.xml⽣成位置 --><sqlMapGenerator targetPackage="mapper"targetProject="src/main/resources"><property name="enableSubPackages" value="true"/></sqlMapGenerator><!-- DAO类⽣成位置 --><javaClientGenerator type="XMLMAPPER"targetPackage="com.example.mybatisplustest.dao" targetProject="src/main/java"><property name="enableSubPackages" value="true"/></javaClientGenerator><!-- 配置⽣成表与实例, 只需要修改表名tableName, 与对应类名domainObjectName 即可--><table tableName="t_article" domainObjectName="Article"enableSelectByExample="false"enableDeleteByExample="false" enableDeleteByPrimaryKey="false"enableCountByExample="false"enableUpdateByExample="false"><!-- 类的属性⽤数据库中的真实字段名做为属性名, 不指定这个属性会⾃动转换为驼峰命名规则--><property name="useActualColumnNames" value="true"/></table><table tableName="t_article_reply" domainObjectName="ArticleReply"enableSelectByExample="false"enableDeleteByExample="false" enableDeleteByPrimaryKey="false"enableCountByExample="false"enableUpdateByExample="false"><property name="useActualColumnNames" value="true"/></table><table tableName="t_board" domainObjectName="Board"enableSelectByExample="false" enableDeleteByExample="false"enableDeleteByPrimaryKey="false" enableCountByExample="false"enableUpdateByExample="false"><property name="useActualColumnNames" value="true"/></table><table tableName="t_message" domainObjectName="Message"enableSelectByExample="false"enableDeleteByExample="false" enableDeleteByPrimaryKey="false"enableCountByExample="false"enableUpdateByExample="false"><property name="useActualColumnNames" value="true"/></table><table tableName="t_user" domainObjectName="User"enableSelectByExample="false" enableDeleteByExample="false"enableDeleteByPrimaryKey="false" enableCountByExample="false"enableUpdateByExample="false"><property name="useActualColumnNames" value="true"/></table></context>
</generatorConfiguration>

4、收尾工作

  1. 在每一个xml文件中的插入语句的后面加入useGeneratedKeys="true" keyProperty="id" >
  2. 在dao文件中的每个Mapper语句上方,加上@Mapper注解
  3. 在model中加@Data,删除get set
  4. 配置扫描路径,在config包下,新建一个MybatisConfig类,用于指定扫描路径
@Configuration
@MapperScan("com/example/mybatisplustest/dao")
public class MybatisConfig{}

5.yml文件中配置扫描路径

mybatis:mapper-locations: classpath:mapper/**/*.xml
http://www.dtcms.com/wzjs/240669.html

相关文章:

  • 河南省建设厅执业资格注册中心网站南昌seo全网营销
  • 做全景图有哪些网站企业网站优化服务
  • 手机做任务的网站有哪些内容湖南优化电商服务有限公司
  • 有没有做丝网的网站呀让顾客心动的句子
  • 腾讯学生云服务器如何做网站百度推广代理商
  • 2018网站内容和备案网络营销推广策划的步骤是什么
  • 给人做网站赚钱在线刷seo
  • 西宁网站建设的公司哪家好郑州百度推广公司地址
  • 中国广东手机网站建设手机关键词seo排名优化
  • 武汉专业做网站深圳推广系统
  • 建站代理平台seo搜索引擎优化就业指导
  • 做不锈钢百度网站哪个比较好如何做网络营销推广
  • 西樵网站制作公司互联网营销专业
  • wordpress 大型网站吗微信广告投放平台
  • 如何获取网站访客qq百度官方认证
  • 仿政府网站关键词排名优化公司哪家强
  • 效果图网站源码北京seo供应商
  • 外贸客户管理软件排名网站seo属于什么专业
  • 抖抈app软件下载seo技术中心
  • 网站推广公司推广宣传文案
  • 苹果软件做ppt下载网站有哪些内容淘宝seo搜索引擎优化
  • 建设网站必须要配置apache吗展示型网站设计公司
  • 网站定制开发四大基本原则yahoo搜索引擎入口
  • Md5(Wordpress)解密seo是搜索引擎优化
  • 中小企业网站建设示范平台百度关键词的费用是多少
  • 社保在哪个网站做增员热搜词排行榜
  • 山东企业网站备案西安seo哪家好
  • 杭州哪家公司做网站最基本的网站设计
  • wordpress太难用了南宁seo做法哪家好
  • 塘厦网站建设最近重大新闻