1.5k 1 分钟

# SpringBoot 启动流程分析 <span alt='solid'> 查看启动流程分析图 </span>. 嫌图小可以去浏览器上看会大一点清晰一点但是,需要翻墙观看或者开启 Github 加速器 https://raw.githubusercontent.com/PigPigLetsGo/imeages/master/202309132014257.png 点断后进行 Debug SpringBoot 启动类 接着下一步 new new SpringApplication...
8.1k 7 分钟

# SpringBoot 自动配置 Condition Condition 是在 Spring4.0 增加的条件判断功能,通过这个功能可以实现选择性的创建 Bean 操作。 思考问题: SpringBoot 是如何知道要创建哪个 Bean 的?比如 SpringBoot 是如何知道要创建 RedisTemplate 的?我们导入了 redis-starter 起步依赖,然后 SpringBoot 就帮我创建了 RedisTemplate 了,那么如果我没有导入 redis-starter 起步依赖那 SpringBoot 会不会帮我创建 RedisTemplate 呢,SpringBoot...
761 1 分钟

MyBatis 中 $ 与 #的区别 1.# 是将传入的值当作字符串的形式,eg:select id,name,age from student where id = #{id}, 当前端把 id 值 1, 传入到后台的时候,就相当于 select id,name,age from student where id = '1' 2.$ 是将传入的数据直接显示生成 SQL 语句,eg:select id,name,age from student where id = ${id}, 当前端把 id 值 1 传入到后台的时候,就相当于 select id,name,age from...
309 1 分钟

多个参数用 Map, 或者注解 接口 public interface UserDao {// map 查询数据 User getUserById1(Map<String,Object> map);} UserDaoMapper.xml <!-- 多个参数 --> <select id="getUserById1" parameterType="map" resultType="com.dkx.mybatis.pojo.User">...
897 1 分钟

问题描述: org.apache.ibatis.binding.BindingException: Type interface com.dkx.mybatis01.dao.UserDao is not known to the MapperRegistry. 报错原因:缺少了 mappers 配置注册标签 <?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config...
292 1 分钟

问题描述: Error:(3, 28) java: package org.apache.ibatis.io does not existError:(4, 33) java: package org.apache.ibatis.session does not existError:(5, 33) java: package org.apache.ibatis.session does not existError:(6, 33) java: package org.apache.ibatis.session does not exist点开 maven 窗口,点击 m 执行命令: mvn...
318 1 分钟

问题描述: 使用 SpringBoot+MyBatis 的时候查询一张表的 count (*) 的时候报错如下: A query was run and no Result Maps were found for the Mapped Statement 'com.dkx.dao.UserMapper.comPageSize'. It's likely that neither a Result Type nor a Result Map was specified. 翻译: 运行了一个查询,但找不到映射语句...
2.4k 2 分钟

问题描述: 当我们使用 maven 搭建 MyBatis 时,maven 在程序运行进行编译时,如果 mybati 使用外部配置文件,会发生 url 替换错误的现象 org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.sql.SQLException: No suitable driver found for http://www.example.com ### The error may exist in UserMapper.xml ### The error...
174 1 分钟

问题描述: URL is not registered(Settings | Languages & Frameworks | Schemas aand DTDs) 解决方案: 点击 "settings" --> "Language&Frameworks" --> "Schemas and DTDs"