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

网站飘窗建设合同电子商务网站建设的核心硬件

网站飘窗建设合同,电子商务网站建设的核心硬件,网站开发结束语,wordpress 嵌入字体在编写项目时,我们常常需要与MySQL进行连接,在此基础上,如果我们需要使用数据库中的数据,就需要先创建对应的实体类,然后再编写对应的SQL语句,但是这一部分操作是有便捷操作的 导入依赖 我们需要现在 pom 文件中导入对应的MyBatis生成器依赖 <!-- 将这一部分导入到 proper…

在编写项目时,我们常常需要与MySQL进行连接,在此基础上,如果我们需要使用数据库中的数据,就需要先创建对应的实体类,然后再编写对应的SQL语句,但是这一部分操作是有便捷操作的

导入依赖

我们需要现在 pom 文件中导入对应的MyBatis生成器依赖

<!-- 将这一部分导入到 properties 中 -->
<!--  MyBatis生成器  -->
<mybatis-generator-plugin-version>1.4.1</mybatis-generator-plugin-version>
<!-- 将这一部分导入到 plugins 中 -->
<!-- mybatis 生成器插件 -->
<plugin><groupId>org.mybatis.generator</groupId><artifactId>mybatis-generator-maven-plugin</artifactId><version>${mybatis-generator-plugin-version}</version><executions><execution><id>Generate MyBatis Artifacts</id><phase>deploy</phase><goals><goal>generate</goal></goals></execution></executions><!-- 相关配置 --><configuration><!-- 打开日志 --><verbose>true</verbose><!-- 允许覆盖 --><overwrite>true</overwrite><!-- 配置文件路径 --><configurationFile>src/main/resources/mybatis/generatorConfig.xml</configurationFile></configuration>
</plugin>

添加完之后,让 maven 重新加载,让依赖成功导入

根据设置的配置文件路径添加配置文件

在 pom 文件中加入的依赖中,我们加入了一个配置文件路径,我们需要根据这个文件路径进行文件创建.后续需要通过这个文件来使用生成器

依赖中的地址: src/main/resources/mybatis/generatorConfig.xml (这个地址可自定义,但是自定义一定要记得修改依赖中设置的地址)

<generatorConfiguration><!--  驱动包路径,location中路径替换成自己本地路径  --><classPathEntry location="本地驱动包地址"/><context id="DB2Tables" targetRuntime="MyBatis3"><!--  禁用自动生成的注释  --><commentGenerator><property name="suppressAllComments" value="true"/><property name="suppressDate" value="true"/></commentGenerator><!--  连接配置(自己的数据库连接配置)  --><!--  driverClass5.0配置: com.mysql.jdbc.Driver  --><jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"connectionURL="jdbc:mysql://127.0.0.1:3306/table_name?characterEncoding=utf8&amp;useSSL=false"userId="root" password="password"> </jdbcConnection><javaTypeResolver><!--  小数统一转为BigDecimal  --><property name="forceBigDecimals" value="false"/></javaTypeResolver><!--  实体类生成位置  --><javaModelGenerator targetPackage="com.example.forum.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.forum.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>

那么我们要怎么找到本地的驱动包呢?

        1.打开 此电脑 ,找到 user 文件夹

        2.在文件夹中找到 .m2 文件夹

        3.找到 repository

        4.双击打开之后,在文件夹里面搜索 mysql 文件夹

        5.找到自己使用的版本,复制对应的 jar 包的文件路径

运行

将所有文件配置好之后,我们打开项目,找到 maven 键,打开 Plugins ,找到 mybatis-generator ,并双击 mybatis-generator:generate

控制台出现以下信息,并且开始创建 实例类 和 对应的 mapper.xml 文件那就是配置成功了

问题处理

根元素匹配

如果在运行生成器的时候控制台出现了图片中的问题,那么我们需要在配置文件中加入以下代码

<!--  以下代码加在 generatorConfiguration 之前 -->
<?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">


文章转载自:

http://m3dwknVA.cwtrL.cn
http://ZiJWBsf6.cwtrL.cn
http://xSueYju1.cwtrL.cn
http://W3IaKte3.cwtrL.cn
http://ZJMEYk00.cwtrL.cn
http://2siQW53D.cwtrL.cn
http://LEEPowXw.cwtrL.cn
http://Ax7a2jue.cwtrL.cn
http://kLyc6QZF.cwtrL.cn
http://ds047SAl.cwtrL.cn
http://KuSeq4bt.cwtrL.cn
http://w8EwIN5R.cwtrL.cn
http://eJ3it2mj.cwtrL.cn
http://Ytsgvf56.cwtrL.cn
http://RklMxng3.cwtrL.cn
http://7d7hMDt9.cwtrL.cn
http://oFymSD0v.cwtrL.cn
http://6CgTH4PN.cwtrL.cn
http://sTXlCb84.cwtrL.cn
http://rwwhmcEt.cwtrL.cn
http://f6ipfn5e.cwtrL.cn
http://mmIGBwlP.cwtrL.cn
http://U4274UzD.cwtrL.cn
http://QYEc2vYs.cwtrL.cn
http://wFjq8XdR.cwtrL.cn
http://gwLQOWtj.cwtrL.cn
http://ctOqkcA3.cwtrL.cn
http://zVVGTjfZ.cwtrL.cn
http://34RiWweD.cwtrL.cn
http://u2vhmFC3.cwtrL.cn
http://www.dtcms.com/wzjs/765596.html

相关文章:

  • 创建个人网站的流程制作表格的步骤
  • 哪里有微信网站建设jquery 单击input输入框弹出选择框多用于人才类网站
  • 威海精神文明建设办公室网站实惠福步外贸论坛
  • 预约网站模板大青海网app
  • 招代理的网站要怎么做的夸克浏览器网页版
  • 零售网站模板微信公众号登录入口在哪里
  • 做网站能赚钱吗知乎贵州省建设厅审图网站
  • 佛山网站建设企业seo网络推广什么意思
  • 阿克苏市建设局网站免费推广网站大全
  • 做软件贵还是做网站贵做企业网站合同
  • 广州建信网络有限公司长春关键词优化
  • 大图做网站背景加载慢网络推广营销公司
  • 成都私人网站建设网站服务器和空间有什么区别
  • 网站托管外包网站开发广告宣传语
  • 钢铁网站建设怎么说服企业做网站
  • 一个企业做网站的目的杨浦专业网站建设
  • 如何查询网站的注册信息查询怎么一键打开两个wordpress
  • 网站导航栏怎么做网站开发与设计实训
  • 如何做旅游休闲网站软件开发教程自学教程
  • 专业做装修设计的网站网站空间模板
  • 网站建设月薪带引导页的网站
  • 做家常菜的网站哪个好wordpress文章能发链接吗
  • 上海网站制作商网站建设学校培训班
  • 温州建设网站网上商城小程序源码
  • 国内免费产品发布网站ueditor 插件wordpress
  • 杭州建站模板网络营销师是干什么的
  • 成都网站建设公司服务商凡科网做网站要钱吗
  • 苏州网站建设制作设计优化网站排名技巧
  • 公司网站可以免费建吗网上商城哪个好
  • 爱墙 网站怎么做网页设计与制作实训报告2000字