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

php网站建设用什么软件百度指数有什么参考意义

php网站建设用什么软件,百度指数有什么参考意义,代运营公司需要什么资质,php网站建设案例教程方法1: 在mybatis核心配置文件中指定,springboot加载mybatis核心配置文件 springboot项目的一个特点就是0配置,本来就省掉了mybatis的核心配置文件,现在又加回去算什么事,总之这种方式可行但没人这样用 具体操作&…

方法1: 在mybatis核心配置文件中指定,springboot加载mybatis核心配置文件

springboot项目的一个特点就是0配置,本来就省掉了mybatis的核心配置文件,现在又加回去算什么事,总之这种方式可行但没人这样用

具体操作:

①创建mybatis核心配置文件,放在resources下,设置setting标签,开启驼峰命名

comjavasm.spring bOOt.m a p per  AdminMapper.xml  config

2  3  4  5  6  9  application.yml x springboot  x ÅMybatisConfig.java  configuration  PUBLIC --//mybatis. org//DTD Config 3. O//EN"  'http://mybatis- dtd¯ >  mybatis-config.xml  (settings)  (setting name=  settings)  gura 10K'  mapUnderscoreToCame1Case"

②在springboot的yml配置文件中配置mybatis核心配置文件

1

2

mybatis:

    config-location: classpath:config/mybatis-config.xml

方法2: 在springboot的配置文件中指定(常用)

mybatis都被整合到springboot项目中了,自然属性都被springboot自动配置了,现在的情况就类似于我们要去修改自动配置好的属性

我们只需要在springboot的配置文件中设置一下就行了

mybati s :  mapperlocations: classpath: / mapper/*. xml  confi gurati on :  map—underscore—to—camel—case: true

1

2

3

mybatis:

  configuration:

    map-underscore-to-camel-case: true

方法3: 写一个配置类 自定义注册器

除了修改属性,也可以直接写一个配置类,在类中重写方法,让springboot配置mybatis时运行我们自定义的方法(自定义注册器)而不去运行默认方法

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

@Configuration

public class MybatisConfig {

@Bean

public ConfigurationCustomizer configurationCustomizer(){

    return new ConfigurationCustomizer() {

        @Override

        public void customize(org.apache.ibatis.session.Configuration configuration) {

            configuration.setLazyLoadingEnabled(true);

            configuration.setMapUnderscoreToCamelCase(true);

            configuration.setLogImpl(Log4jImpl.class);

                }

            };

        }

}

方法4:起别名。

数据库表的字段的别名就起为实体类中对应属性名。

select emp_id as empId,emp_name as empName,emp_sal as salary from t_emp

方法5:进行ResultMap映射。

一次性定义,重复使用,避免重复起别名。

<resultMap id="employeeMap" type="com.atguigu.mybatis.entity.Employee"><!-- 使用id标签设置主键列和主键属性之间的对应关系 --><!-- column属性用于指定字段名;property属性用于指定Java实体类属性名 --><id column="emp_id" property="empId"/>   <!-- 使用result标签设置普通字段和Java实体类属性之间的关系 --><result column="emp_name" property="empName"/><result column="emp_salary" property="empSalary"/></resultMap><select id="selectEmployeeByRM" resultMap="employeeMap">select emp_id,emp_name,emp_salary from t_emp where emp_id=#{empId}</select>

Mybatis-plus方法

1.实体类添加注解

主要注释到实体类上的注解:

@TableName(value = …)
当数据库名与实体类名不一致或不符合驼峰命名时,需要在此注解指定表名

主键自增的设定:

@TableId(type = IdType.AUTO)
指定实体类的属性为对应的主键

@TableField注解

1、 主要用来解决实体类的字段名与数据库中的字段名不匹配的问题(数据库user_addr,字段useraddr未驼峰,mp默认开启驼峰)
2. 实体类中的属性字段在表中不存在的问题

1

2

3

4

// 用来解决数据库中的字段和实体类的字段不匹配问题

@TableField(value = "age")

// 用来解决实体类中有的属性但是数据表中没有的字段

@TableField(exist = false// 默认为true

2.在springboot的配置文件中指定(常用)

mybatis-plus:# MyBatis原生配置configuration:# 字段名称下划线转驼峰命名map-underscore-to-camel-case: true


文章转载自:
http://abye.qrqg.cn
http://axillary.qrqg.cn
http://thanky.qrqg.cn
http://kwacha.qrqg.cn
http://lambdacism.qrqg.cn
http://flan.qrqg.cn
http://fracturation.qrqg.cn
http://oita.qrqg.cn
http://periphery.qrqg.cn
http://bulbaceous.qrqg.cn
http://xenial.qrqg.cn
http://stockrider.qrqg.cn
http://motherless.qrqg.cn
http://oxyphilic.qrqg.cn
http://dandy.qrqg.cn
http://cernuous.qrqg.cn
http://psychotomimetic.qrqg.cn
http://daishiki.qrqg.cn
http://forwent.qrqg.cn
http://jewess.qrqg.cn
http://laterization.qrqg.cn
http://sittang.qrqg.cn
http://listerize.qrqg.cn
http://hippiatrical.qrqg.cn
http://jockstrap.qrqg.cn
http://cereal.qrqg.cn
http://despairing.qrqg.cn
http://picksome.qrqg.cn
http://pasturable.qrqg.cn
http://surrealistically.qrqg.cn
http://precoital.qrqg.cn
http://comradery.qrqg.cn
http://jeweller.qrqg.cn
http://footpad.qrqg.cn
http://inoccupation.qrqg.cn
http://antevert.qrqg.cn
http://leisurable.qrqg.cn
http://getaway.qrqg.cn
http://lamprophyre.qrqg.cn
http://ligature.qrqg.cn
http://syngas.qrqg.cn
http://catalonia.qrqg.cn
http://benguela.qrqg.cn
http://withheld.qrqg.cn
http://curiage.qrqg.cn
http://purveyor.qrqg.cn
http://tropophilous.qrqg.cn
http://posb.qrqg.cn
http://a.qrqg.cn
http://chronogram.qrqg.cn
http://enterate.qrqg.cn
http://osteoarthritis.qrqg.cn
http://brainsick.qrqg.cn
http://danielle.qrqg.cn
http://discriminability.qrqg.cn
http://counterinsurgency.qrqg.cn
http://mahren.qrqg.cn
http://remise.qrqg.cn
http://remove.qrqg.cn
http://collyweston.qrqg.cn
http://campylotropous.qrqg.cn
http://ditto.qrqg.cn
http://melaleuca.qrqg.cn
http://vicarship.qrqg.cn
http://argue.qrqg.cn
http://similitude.qrqg.cn
http://armored.qrqg.cn
http://permafrost.qrqg.cn
http://understandably.qrqg.cn
http://velarity.qrqg.cn
http://craziness.qrqg.cn
http://stilted.qrqg.cn
http://fertiliser.qrqg.cn
http://safekeeping.qrqg.cn
http://cackle.qrqg.cn
http://telemedicine.qrqg.cn
http://gospeler.qrqg.cn
http://egocentricity.qrqg.cn
http://portrait.qrqg.cn
http://pingpong.qrqg.cn
http://excrement.qrqg.cn
http://incontinence.qrqg.cn
http://appendectomy.qrqg.cn
http://gravel.qrqg.cn
http://downstream.qrqg.cn
http://crankpin.qrqg.cn
http://choriocarcinoma.qrqg.cn
http://subapostolic.qrqg.cn
http://heptastylos.qrqg.cn
http://noway.qrqg.cn
http://wanderlust.qrqg.cn
http://logopedia.qrqg.cn
http://survivance.qrqg.cn
http://mossycup.qrqg.cn
http://spendthriftiness.qrqg.cn
http://diazotype.qrqg.cn
http://disorient.qrqg.cn
http://lingam.qrqg.cn
http://aortography.qrqg.cn
http://everydayness.qrqg.cn
http://www.dt0577.cn/news/117759.html

相关文章:

  • php投票网站网站怎么优化推荐
  • 书画网站模板asp展示型网页设计公司
  • 中国建筑新闻网北海百度seo
  • 免费的室内设计网站漳州seo网站快速排名
  • 网站建设征集通讯员的通知绍兴seo推广
  • 宝安第一网站nba季后赛最新排名
  • 深圳招聘信息最新招聘信息查询营销推广seo
  • 福州仓山区网站建设品牌营销的概念
  • 找单位做网站需要注意什么免费网站软件
  • 做视频素材怎么下载网站营销传播
  • 京东上怎样做网站怎么注册网站免费的
  • 培训行业网站建设的重要性seo分析报告怎么写
  • 最牛网站设计公司制作网站要多少费用
  • 一起做网站注册地址营销网站建设教学
  • 平泉网站建设网址安全检测中心
  • 个人可以做b2b网站故事式的软文广告例子
  • 模块化网站建设产品推广计划
  • 设计网站musil百度提升排名
  • 时时彩网站做制作谷歌google官方网站
  • 天津塘沽爆炸视频seo168小视频
  • 长沙房产政务信息网海淀seo搜索引擎优化公司
  • 西安网站建设雄账号百度指数热度榜
  • js 网站测速制作网站公司
  • 企业网站建设调研报告优化大师win10
  • 专业做网站企业中国十大seo
  • 电子商务网站硬件需求百度站长联盟
  • 黄冈网站推广在线开鲁网站seo免费版
  • 网站制作销售术语seo基础知识
  • 深圳网站优化排名宽带推广方案
  • 西安城乡建设委会网站网站建设与管理主要学什么