springboot3 springboot mybatis mapper

【SpringBoot】【配置加载】 SpringBoot配置加载解析时机原理

1 前言 不知道大家对于配置文件的加载有没有考虑过是什么时候加载解析的,这节我们就来看看。 2 执行入口 我们就先来看看加载配置的入口,核心类就是 ConfigFileApplicationListener主要作用就是读取应用的配置文件并add到Environment的PropertySources ......
SpringBoot 时机 原理

pom非常好用的写法,统一管理springboot有关依赖的版本

相信大家使用maven的时候,每引用一个依赖都要写一遍版本号,当然这是必要的,现在springboot非常的主流,每个springboot有关的依赖的版本又是一至的 我们大家就不需要重新去再写一遍了,可以引入依赖 spring-boot-dependencies,这样后面所有的有关springboo ......
写法 springboot 版本 pom

SpringBoot+Redis+自定义注解实现接口防刷(限制不同接口单位时间内最大请求次数)

场景 SpringBoot搭建的项目需要对开放的接口进行防刷限制,不同接口指定多少秒内可以请求指定次数。 比如下方限制接口一秒内最多请求一次。 注: 博客: https://blog.csdn.net/badao_liumang_qizhi 实现 1、实现思路 首先自定义注解,添加时间区间和最大请求 ......
接口 注解 SpringBoot 次数 单位

Mybatis-Plus generator

自动生成 CodeGenerator.java package com.lily.blog; import com.baomidou.mybatisplus.generator.FastAutoGenerator; import com.baomidou.mybatisplus.generator. ......
Mybatis-Plus generator Mybatis Plus

Mybatis

1 创建Maven使用mybatis 1.1 设置 1设置Maven->conf 设置默认JDK <profile> <id>jdk11</id> <activation> <activeByDefault>true</activeByDefault> <jdk>11</jdk> </activat ......
Mybatis

解决Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource数据源无法连接 springboot项目无法启动的问题

<groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.13</version> </dependency> 开始没有制定版本 报错换成了8.0版本,依旧报错 看了下配置文件 没有问题 查 ......

springboot alibaba druid数据库连接池配置,输出可执行sql

# 数据源配置 spring: datasource: type: com.alibaba.druid.pool.DruidDataSource druid: # 初始连接数 initialSize: 5 # 最小连接池数量 minIdle: 2 # 最大连接池数量 maxActive: 50 # ......
springboot alibaba 数据库 数据 druid

Springboot创建多module项目--转载

1)create new project ( 或 File --> new --> project) 2)选中Spring Initializr ,点击Next image.png 3)填写必要信息,点击Next image.png 4)依赖页不用勾选,点击Next image.png 5)选择项目 ......
Springboot 项目 module

Springboot-hbase增删改20230509

1、启动 2、ZK客户端 3、springboot+hbase实例 1)、pom <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</ ......
Springboot-hbase Springboot 20230509 hbase

Mybatis拦截器解决<foreach>列表为空报错问题

在mybatis中使用<foreach>标签时, 如果传入的列表为空, 则解析为sql语句时<foreach>标签所在位置会被解析为空, 最终的sql呈现为in ()或者in后面的内容为空, 从而导致sql语法错误。 网上找了很多种方法,如果用到foreach的地方比较多,用拦截器来处理可能会更好。 ......
Mybatis foreach 问题 lt gt

MyBatis逆向工程配置文件及一些配置解释(跑通)

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://m ......
逆向工程 MyBatis 文件 工程

mybatis @Intercepts @Signature

详细介绍 点击这里 @Intercepts是mybatis中的一个常用拦截器注解,表明当前对象是一个拦截器。 @Intercepts // 描述:标志该类是一个拦截器 @Signature // 描述:指明该拦截器需要拦截哪一个接口的哪一个方法 type; // 四种类型接口中的某一个接口,如Exe ......
Intercepts Signature mybatis

mybatis 自定义序列号

功能需求:每天的序列号从1开始,保留四位数,不足4位往前补0 1,新建一张表 CREATE TABLE `sequence` ( `day_id` date DEFAULT NULL COMMENT '账期', `name` varchar(50) COLLATE utf8mb4_bin NOT N ......
序列号 序列 mybatis

SpringBoot - 参数接收方式

SpringBoot -参数接收方式 · 前言 · 使用@PathVariable接收路径中的参数 · 使用@RequestParam获取路径中?后的参数 · 使用@RequestBody获取Map对象 · 使用@RequestBody获取实体对象 前言 使用@PathVariable接收路径中的参 ......
SpringBoot 参数 方式

SpringBoot的@Configuration注解

本文主要讲述SpringBoot的@Configuration注解。 一.POJO类的声明 例如有两个pojo类,分别是User和Pet User类的声明如下: public class User { private String name; private Integer age; public ......
注解 Configuration SpringBoot

Springboot 项目配置 HTTPS

生成证书 输入命令 keytool -genkeypair -alias "boot" -keyalg "RSA" -keystore "boot.keystore" 生成完成后会提示 Warning: JKS 密钥库使用专用格式。建议使用 "keytool -importkeystore -src ......
Springboot 项目 HTTPS

SpringBoot项目如何打包成exe应用程序?

前言 近期做了一个前后端合并的spring boot项目,但是要求打包城exe文件,提供给不懂电脑的小白安装使用,就去研究了半天,踩了很多坑,写这篇文章,是想看到这篇文章的人,按照我的步骤走,能少踩坑。 准备 准备工作: 一个jar包,没有bug能正常启动的jar包 exe4j,一个将jar转换成e ......
应用程序 SpringBoot 程序 项目 exe

Apache FtpServer在Windows上使用以及SpringBoot中集成apache ftpserver实现Ftp 服务端搭建

场景 Apache Ftpserver Apache FtpServer是100%纯Java FTP服务器。它被设计为基于当前可用的开放协议的完整且 可移植的FTP服务器引擎解决方案。FtpServer可以作为Windows服务或Unix / Linux守护程序独立运行, 也可以嵌入Java应用程序 ......

springboot整合redisson 异常之一 ……ExceptionInInitializerError

Failed to instantiate [org.redisson.api.RedissonClient]: Factory method 'redissonClient' threw exception; nested exception is java.lang.ExceptionInIni ......

MyBatis 概念与CRUD

MyBatis 一、 概念与简介 1.1 框架概念 ORM ORM(Object Relational Mapping)对象关系映射,将程序中一个对象与表中的一行数据一一对应 ORM映射框架,提供持久化类与表的映射关系,在运行时参照映射文件的信息,把对象持久化到数据库中。 提供动态sql语句(set ......
概念 MyBatis CRUD

使用IDEA创建第一个SpringBoot项目并进行一些基础配置的详细教程

1.打开IDEA,新建new project,填写项目信息。 2.如上图所示,设置server URL为阿里云服务器为: https://start.aliyun.com/ 下面的Java版本选择必须和Project SDK版本相对应,不然不能进行下一步。 3.选择springboot版本和开发会使 ......
SpringBoot 基础 项目 教程 IDEA

MyBatis\MyBatisPlus常用

1.映射数据库中不存在的字段 TableField(exist=false) 2. @Select(“seclect * from user”) List<User> selectAll(); 3. @Select("select * from t_user")@Results(@Result(co ......
MyBatisPlus 常用 MyBatis

2023最新版——新手使用mybatis-plus 3.5.2并使用器代码生成器

最新版——新手使用mybatis-plus 3.5.2并使用器代码生成器 第一步,pom文件引入依赖 主要引入mybatis-plus和代码生成器需要使用的freemaker依赖 <dependency> <groupId>com.baomidou</groupId> <artifactId>myb ......

关于 mybatis-spring-boot-starter 的版本适配问题

写在前面: 本人就读于某不知名二本计科专业,目前大二,正在自学SpringBoot。博客中难免出现谬误,请大家批评指正,不喜勿喷,键盘侠手下留情。 开发环境: IDEA 2022.3.2 JDK 1.8 SpringBoot 2.7.11 Maven 3.9.0 问题描述: 最近在写一个Spring ......

记一次springboot项目漏洞挖掘

前段时间的比赛将该cms作为了题目考察,这个cms的洞也被大佬们吃的差不多了,自己也就借此机会来浅浅测试下这个cms残余漏洞,并记录下这一整个流程,谨以此记给小白师傅们分享下思路,有错误的地方还望大佬们请以指正。 ......
springboot 漏洞 项目

SpringBoot全局异常处理

@ControllerAdvice:使用该注解表示开启了全局异常的捕获; 参考链接 [1]https://www.cnblogs.com/xuwujing/p/10933082.html [2]https://gitee.com/bruce6213/global-exception-handler ......
全局 SpringBoot

使用mybatis-generator 能生成 但是实际使用时抛出异常Invalid bound statement (not found)

好多好多好多红 但是重点是一句org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): {}.dao.mapper.MemberMapper.selectByExample 网络上查了好多次 都没 ......

MyBatis-Plus和PageHelper冲突导致Factory method sqlSessionFactory threw exception

springboot开始引入了mybaits-plus。后来想引入pagehelper进行分页,引入之后报错 Error starting ApplicationContext. To display the conditions report re-run your application wit ......

SpringBoot整合RocketMQ

1 整合RocketMQ 点击了解RocketMQ原理 1.1 相关配置 1.1.1 pom.xml 引入相关依赖 <dependency> <groupId>org.apache.rocketmq</groupId> <artifactId>rocketmq-spring-boot-starter ......
SpringBoot RocketMQ

SpringBoot常用注解

@SpringBootApplication @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited @Configuration @EnableAutoConfiguration @C ......
注解 SpringBoot 常用