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

中小企业的网站建设论文wordpress 定时采集

中小企业的网站建设论文,wordpress 定时采集,模板做网站,自助建站系统搭建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/790457.html

相关文章:

  • 网站文章的作用网站建设详细描述产品的是什么
  • 嵌入式网站开发学习公众号 转 wordpress
  • 企业网站管理系统cms上海有哪些大型企业
  • 同企网站建设做网站网页版qq下载
  • 建设自己网站软件下载企业的网站建设费账务处理
  • 网站地图怎么用闵行网站制作公司
  • 十大免费不收费的网站海贼王网页设计素材
  • 德州网站建设推广价格快速建站公司电话
  • 河南旅游集团 网站建设网站开发公司不干了
  • 青岛建网站的公司河南无限动力做网站怎么样
  • 网站建设及推广方案ppt模板服装设计类网站
  • 想找私人做网站wordpress 搬家 问题
  • 赫山区住房和城乡建设局网站建立网站程序
  • 用什么软件做介绍视频网站程序员做音乐网站
  • 网站建设的结构wordpress 主页位置
  • 揭阳网站建设价格ps做网页设计的尺寸
  • 学校网站建设的重要性中间商网站怎么做
  • 新闻类网站怎么做seo网站建设考试试题
  • 网站建设和seo讲师要求免费网站建设优化
  • 微信公众号素材网站有经验的佛山网站设计
  • 织梦网站做中英文双语言版本制作一个简单的网页步骤
  • 织梦英文版网站怎么做用php做的网站模版
  • wordpress登录api外贸网站如何优化
  • 注册个体可以做网站吗怎么做北京赛车网站
  • 网站的推广方法有哪些网站keywords多少字
  • 南充市房地产网官方网站企业免费做网站
  • 个人网站有哪些企业建站要多少钱
  • 辽宁省建设部网站微信平台商城开发
  • 住房和城乡建设部网站建筑合同网站访问量过大
  • 结构设计网站中国电子网