springboot3 springboot mybatis mapper
SpringBoot集成openGauss
1.pom依赖 <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <depend ......
SpringBoot + MDC 实现全链路调用日志跟踪
简介:MDC(Mapped Diagnostic Context,映射调试上下文)是 log4j 、logback及log4j2 提供的一种方便在多线程条件下记录日志的功能。MDC 可以看成是一个与当前线程绑定的哈希表 ,可以往其中添加键值对。MDC 中包含的内容可以被同一线程中执行的代码所访问 。 ......
MyBatis中#和$的区别
MyBatis中#{}和${}的用法 说一下为什么要写这篇文章,最近面试有被问到,一下子想不出来有啥区别,想记录一下加深自己的理解,同时自己也经常用MyBatis-Plus忽略了XML文件的编写和使用,所以需要加深一下这块的知识 一、例子 1、#{}将传入的数据当作一个字符串,会对传入的数据加上一个 ......
3种 Springboot 全局时间格式化方式,别再写重复代码了
From: https://developer.aliyun.com/article/771395 简介: 别再写重复代码了 本文收录在个人博客:www.chengxy-nds.top,技术资料共享,同进步 时间格式化在项目中使用频率是非常高的,当我们的 API 接口返回结果,需要对其中某一个 da ......
MyBatis
MyBatis本是apache的一个开源项目iBatis,2010年这个项目由apache software foundation迁移到了google code,并且改名为MyBatis。2013年11月迁移到Github。 iBATIS一词来源于“internet”和“abatis”的组合,是一个 ......
mybatis
MyBatis简介(了解) 什么是MyBatis MyBatis 本是apache的一个开源项目iBatis,2010年这个项目由apache software foundation 迁移到了google code,并且改名为MyBatis 。2013年11月迁移到Github。 MyBatis是一 ......
使用maven项目配置并使用mybatis (xml开发)
使用maven项目配置并使用mybatis (xml开发) 1、首先我们使用maven添加依赖 <dependencies> <!-- Junit测试工具 --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> ......
springboot编译失败
拉了一个新分支从master环境 然后编译不通过了 java: You aren't using a compiler supported by lombok, so lombok will not work andhas been disabled.Your processoris: comsun ......
springboot线程池底的使用
1.简单使用 一、配置类 @Configuration @EnableAsync public class SpringAsyncConfig { @Bean("taskExecutor") public Executor asyncServiceExecutor() { ThreadPoolTas ......
springboot 配置 mysql
pom.xml: <!-- database --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <d ......
linux部署springboot
安装jre 第一步:查看Linux系统中是否已存在JRE 首先,我们需要查看Linux系统中是否已经安装了Java运行时环境。我们可以使用命令“ java –version”来查看,如果终端提示“command not found”,则表明JRE未安装;如果显示java版本信息,则表明已安装JRE。 ......
Mybatis-Plus常见操作
package com.ideas.system.service.impl; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; imp ......
MyBatis中 Mapper.xml 文件
resources 目录下 新建文件夹 mapper (个人习惯全路径与Mapper类对应) <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "h ......
mybatis
# 1. mybatis入门 ## 1.mybatis入门 ![image-20230908015141876](https://img2023.cnblogs.com/blog/1147259/202309/1147259-20230919112952207-2099173210.png) - S ......
SpringBoot 后端配置 Https 教程
以阿里云为例子 1. 申请 SSL 证书 1. 注册域名 打开阿里云官网,搜索域名 点击域名注册,输入域名,点击搜索 选择心仪的域名,点击购买,打钱 进入域名控制台,进行实名认证 2. 申请 SSL 证书 打开阿里云官网,搜索 SSL 证书 点击免费证书,领取 20 张券(一年可以领 20 张,可以 ......
聊聊springboot自动装配出现的TypeNotPresentExceptionProxy异常排查
前言 正文开始前,我们做个小测试,假设我们封装了一个springboot starter,其自动装配类形如下内容 @Configuration @EnableConfigurationProperties({ApolloRefreshProperties.class}) public class A ......
@Mapper注解、@MapperScan注解
@Mapper 作用:在接口类上添加了@Mapper,在编译之后会生成相应的接口实现类 添加位置:mapper接口类上面 @Mapper public interface UserMapper { //代码 } 如果想要每个接口都要变成实现类,那么需要在每个接口类上加上@Mapper注解,比较麻烦, ......
Springboot使用@value获取配置文件参数
使用@value获取yml参数值 @Value("${value}") // 多级使用 . 连接 例:${value.value} private String value; @value获取不到值的情况 // 错误1:使用了static或者final修饰value private static S ......
Springboot中使用线程池的三种方式
前言 多线程是每个程序员的噩梦,用得好可以提升效率很爽,用得不好就是埋汰的火葬场。 这里不深入介绍,主要是讲解一些标准用法,熟读唐诗三百首,不会作诗也会吟。 这里就介绍一下springboot中的多线程的使用,使用线程连接池去异步执行业务方法。 由于代码中包含详细注释,也为了保持文章的整洁性,我就不 ......
springboot中配置druid的依赖,与application.yml中设置druid的相关配置
2023-09-18 <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>1.2.16</version> </dependency> appl ......
SpringBoot 启动时报错Unable to start embedded Tomcat
导读 最近公司有个gradle构建的工程,需要改造成maven方式构建(点我直达)。转为maven后,启动时一直报tomcat错误,最终排查是因为servlet-api这个包导致的依赖冲突,将这个依赖排除即可启动 解决 排除依赖,检查项目是否包含:javax.servlet-api <exclusi ......
Springboot简单功能示例-5 使用JWT进行授权认证
博主尝试通过gitee的发行版,使用Springboot为基础框架,逐步整合JWT、JPA、VUE等常用功能项目。【本节完成】使用JWT规范完成登录、确权、登出等操作,分别对html请求和json请求进行处理 ......
启动一个springboot项目
最终效果 在idea中 package com.fqs.helloworld.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.anno ......
【错误异常】The content of element type "mapper" must match "(cache-ref|cache|resultMap*|parameterMap*|sql*|insert*|update*|delete*|select*)+".
The content of element type "mapper" must match "(cache-ref|cache|resultMap*|parameterMap*|sql*|insert*|update*|delete*|select*)+". 服务启动异常 排查mapper.xm ......
springboot中文件上传的controller与配置的文件上传的最大容量
2023-09-18 package com.hh.controller; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Controller; import org.springframework.w ......
springboot整合elasticsearch-RestHighLevelClient api查询
1. 依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-elasticsearch</artifactId> </dependency> <dependen ......
Mybatis 02 mybatis动态代理
mybatis动态代理: 1、创建(UserMapper)Mapper接口,创建相同名称Mapper.xml映射文件,并且保证映射文件和Mapper接口在同一路径下 2、Mapper.xml映射文件的命名空间和接口的全路径一致 <mapper namespace="com.mapper.UserMa ......
Mybatis Plus 分页查询数据
Mybatis Plus 分页查询数据 一、分页配置 package com.example.demomybatispage.config; import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisp ......
Spring,SpringMVC,SpringBoot,SpringCloud有什么区别?
简单介绍 Spring是一个轻量级的控制反转(IoC)和面向切面(AOP)的容器框架。Spring使你能够编写更干净、更可管理、并且更易于测试的代码。 Spring MVC是Spring的一个模块,一个web框架。通过Dispatcher Servlet, ModelAndView 和 View R ......
SpringBoot Jackson 日期格式化统一配置
https://blog.csdn.net/gengzhy/article/details/132031824 目录 1.在全局配置文件配置 2.通过JavaBean方式配置 1.在全局配置文件配置 spring: jackson: date-format: yyyy-MM-dd HH:mm:ss ......