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

网站开发强制使用急速内核外发加工网站源码下载

网站开发强制使用急速内核,外发加工网站源码下载,网站备案转服务器,wordpress控制仪目录 一、MyBatis Generator 的使用 1.1、生成类和映射文件 1.1.1、在 pom.xml 中引入依赖 1.1.2、根据 configurationFile 标签中配置的路径 创建 generatorConfig.xml 文件 1.1.3、自动生成类 和 映射文件 1.1.4、在 Insert 标签中添加获取主键值的选项 1.1.5、扫描配置…目录 一、MyBatis Generator 的使用 1.1、生成类和映射文件 1.1.1、在 pom.xml 中引入依赖 1.1.2、根据 configurationFile 标签中配置的路径 创建 generatorConfig.xml 文件 1.1.3、自动生成类 和 映射文件 1.1.4、在 Insert 标签中添加获取主键值的选项 1.1.5、扫描配置添加 Mapper 注解 / 添加扫描注解 1.1.6、配置 mybatis 1.1.7、测试 一、MyBatis Generator 的使用 1.1、生成类和映射文件 1.1.1、在 pom.xml 中引入依赖 在 properties 标签中加入版本号. mybatis-generator-plugin-version1.4.1/mybatis-generator-plugin-version 在 build plugins 标签中加入如下配置 !-- mybatis ⽣成器插件 --plugingroupIdorg.mybatis.generator/groupIdartifactIdmybatis-generator-maven-plugin/artifactIdversion${mybatis-generator-plugin-version}/versionexecutionsexecutionidGenerate MyBatis Artifacts/idphasedeploy/phasegoalsgoalgenerate/goal/goals/execution/executions!-- 相关配置 --configuration!-- 打开⽇志 --verbosetrue/verbose!-- 允许覆盖 --overwritetrue/overwrite!-- 配置⽂件路径 --configurationFilesrc/main/resources/mybatis/generatorConfig.xml/configurationFile/configuration/plugin上述配置中需要注意的是 “配置文件路径”这个路径就是用来生成 实体类和映射文件 配置规则的位置. 1.1.2、根据 configurationFile 标签中配置的路径 创建 generatorConfig.xml 文件 这个文件就是用来描述生成规则的. 根据路径src/main/resources/mybatis在 mybatis 目录下创建 generatorConfig.xml 文件. Ps下述配置文件中需要修改的有 数据库连接、实体类和映射文件的路径、数据库表名 ?xml version1.0 encodingUTF-8? !DOCTYPE generatorConfigurationPUBLIC -//mybatis.org//DTD MyBatis Generator Configuration 1.0//ENhttp://mybatis.org/dtd/mybatis-generator-config_1_0.dtdgeneratorConfiguration!-- 驱动包路径location中路径替换成⾃⼰本地路径 --classPathEntry locationD:\class\source\mysql-connector-java-5.1.49.jar/context idDB2Tables targetRuntimeMyBatis3!-- 禁⽤⾃动⽣成的注释 --commentGeneratorproperty namesuppressAllComments valuetrue/property namesuppressDate valuetrue//commentGenerator!-- 连接配置 --jdbcConnection driverClasscom.mysql.jdbc.DriverconnectionURLjdbc:mysql://127.0.0.1:3306/javanav_db? characterEncodingutf8amp;useSSLfalseuserIdrootpassword1111/jdbcConnectionjavaTypeResolver!-- ⼩数统⼀转为BigDecimal --property nameforceBigDecimals valuefalse//javaTypeResolver!-- 实体类⽣成位置 --javaModelGenerator targetPackagecom.example.cyk.modeltargetProjectsrc/main/javaproperty nameenableSubPackages valuetrue/property nametrimStrings valuetrue//javaModelGenerator!-- mapper.xml⽣成位置 --sqlMapGenerator targetPackagemappertargetProjectsrc/main/resourcesproperty nameenableSubPackages valuetrue//sqlMapGenerator!-- mapper 接口⽣成位置 --javaClientGenerator typeXMLMAPPERtargetPackagecom.example.cyk.mapper targetProjectsrc/main/javaproperty nameenableSubPackages valuetrue//javaClientGenerator!-- 配置⽣成表与实例, 只需要修改表名tableName, 与对应类名domainObjectName 即可--table tableNamej_article domainObjectNameArticleenableSelectByExamplefalseenableDeleteByExamplefalse enableDeleteByPrimaryKeyfalseenableCountByExamplefalseenableUpdateByExamplefalse!-- 类的属性⽤数据库中的真实字段名做为属性名, 不指定这个属性会⾃动转换 _ 为驼峰命名规则--property nameuseActualColumnNames valuetrue//tabletable tableNamej_article_reply domainObjectNameArticleReplyenableSelectByExamplefalseenableDeleteByExamplefalse enableDeleteByPrimaryKeyfalseenableCountByExamplefalseenableUpdateByExamplefalseproperty nameuseActualColumnNames valuetrue//tabletable tableNamej_board domainObjectNameBoardenableSelectByExamplefalse enableDeleteByExamplefalseenableDeleteByPrimaryKeyfalse enableCountByExamplefalseenableUpdateByExamplefalseproperty nameuseActualColumnNames valuetrue//tabletable tableNamej_message domainObjectNameMessageenableSelectByExamplefalseenableDeleteByExamplefalse enableDeleteByPrimaryKeyfalseenableCountByExamplefalseenableUpdateByExamplefalseproperty nameuseActualColumnNames valuetrue//tabletable tableNamej_user domainObjectNameUserenableSelectByExamplefalse enableDeleteByExamplefalseenableDeleteByPrimaryKeyfalse enableCountByExamplefalseenableUpdateByExamplefalseproperty nameuseActualColumnNames valuetrue//table/context /generatorConfiguration注意 驱动包路径是自己本地仓库的路径 但一定注意 需要在非中文的目录下因此你可以把这个驱动包拷贝出来放到一个非中文的目录中即可. 1.1.3、自动生成类 和 映射文件 重新加载Maven项⽬在Plugins节点下出现mybatis-generator双击运⾏在对应的目录下⽣成相应的类与映射⽂件 接着你就可以看到对应的生成了 1.1.4、在 Insert 标签中添加获取主键值的选项 在生成的 xml 文件中给每一个 insert 标签都添加以下属性useGeneratedKeystrue keyPropertyid !-- useGeneratedKeys true -- !-- keyProperty 主键字段-- !-- 当插⼊⼀条数据后可以通过user.getId()获取到⾃动⽣成的Id值如果⽅法中需要⽴即获取Id值加⼊这个配置 -- insert idinsert parameterTypecom.example.cyk.model.User useGeneratedKeystrue keyPropertyid Ps这个选项也可以自动生成但是不理想有些问题 1.1.5、扫描配置添加 Mapper 注解 / 添加扫描注解 有两种方式配置扫描 Mapper 接口. 1给每个 mapper 包下的 mapper 接口都添加 Mapper 注解. 2给启动类上 或者 新建一个配置类有 Configuration 注解加上 MapperScan(com.example.cyk.mapper) 注解. 1.1.6、配置 mybatis 在 yml 文件中配置 mybatis:mapper-locations: classpath:mapper/**/*Mapper.xml1.1.7、测试 SpringBootTest public class TestMapper {Autowiredprivate UserMapper userMapper;Testpublic void select() {User user userMapper.selectByPrimaryKey(1L);System.out.println(user);}}
http://www.dnsts.com.cn/news/182107.html

相关文章:

  • wordpress做网站卡吗wordpress建站以后
  • 做网站gif代码简单网页编辑软件
  • 襄州区住房和城乡建设局网站中卫市设计院
  • 怎么建立免费的网站照片编辑软件
  • 建个什么网站赚钱php做网站的公司有哪些
  • 网站默认首页杭州专业做网站
  • 一个销售网站的设计 应当是要企业网络推广情况介绍
  • 做软件营销网站怎么样上海天华建筑设计有限公司合肥分公司
  • 用.aspx做网站wordpress设置插件
  • ps怎么艺术字字体设计网站wordpress的博文页面如何自定义
  • 合肥网站建设 合肥网络推广商城网站开发培训学校
  • 深圳龙岗企业网站建设asp企业网站cms
  • 现在哪个网站做电商好闵行区牙防所
  • 平原网站建设费用网页制作是什么软件
  • 千图网解析网站怎么做西宁网站建设最大的公司
  • 网站建设 手机app在线crm平台
  • 邢台宇鹏网站建设wordpress托管服务
  • 培训前端网站开发太原做网络推广的公司
  • 中交建设集团网站新闻网页设计师的发展前景
  • 网站建设注册哪类商标做网站哪家公司
  • 的网站建立长沙同城
  • 自己做自己的私人网站wordpress调用指定分类的文章列表
  • 蓝色大气网站模板广州展厅设计公司排名
  • 东营区住房和城乡建设局网站徐汇郑州阳网站建设
  • 网站seo排名公司网建是什么
  • 贵港购物网站开发设计做网站卖什么
  • 合肥网站关键词seo优化公司网页设计dw成品
  • 东莞网站建设制作公司排名做网站用哪个写比较好
  • 天津如何做百度的网站养育成本
  • 网站配色分析营销型企业网站建设的功能