
database
文章平均质量分 77
走向自由
追随自己内心的声音,走向自由。
展开
-
Mybatis3 批量执行操作
最近碰到几道Mybatis3的面试题,记录下。原创 2025-03-16 16:37:22 · 432 阅读 · 0 评论 -
Mybatis3 调用存储过程
这里的存储过程为了展示功能,使用了IN和OUT类型两种参数。具体的功能为:根据输入的页面编号和页面数据量参数,返回总的页数和总数据量。同时返回查询的页面数据集合。ENDMySQL workbench console调用,检查procedure正确性小提示:MySQL 存储过程局部变量和全局变量区别和使用1. 局部变量局部变量是在存储过程或函数中声明的变量,其作用域仅限于该存储过程或函数内部。声明局部变量局部变量必须在存储过程的开头声明,且在BEGIN。原创 2025-03-13 13:40:43 · 798 阅读 · 0 评论 -
Mybatis Generator 使用手册
MyBatis生成器(MBG)是MyBatis框架的代码生成工具。它支持为所有版本的MyBatis生成代码,通过解析数据库表(或多个表)结构,自动生成用于访问这些表的相关组件。这有效减轻了手动配置对象和配置文件以实现数据库表交互的初始繁琐工作。MBG主要致力于简化大量基础性的数据库操作——即常见的增删改查(CRUD)操作。但对于涉及联合查询或存储过程等复杂场景,仍需开发者手动编写SQL和对象。原创 2025-03-08 22:16:28 · 1084 阅读 · 0 评论 -
Mybatis3 学习笔记
02.SSM-mybatis-快速入门(上)_哔哩哔哩_bilibili原创 2025-02-22 16:02:36 · 133 阅读 · 0 评论 -
Mybatis 一/二级缓存关系及访问顺序
根据上述源码分析,MyBatis 3 中一级缓存和二级缓存的访问顺序如下:一级缓存:首先检查 SqlSession 的一级缓存。二级缓存:如果一级缓存中没有数据,则检查 Mapper 的二级缓存。数据库查询:如果一级缓存和二级缓存中都没有数据,则执行数据库查询,并将结果存入二级缓存和一级缓存。这种顺序确保了缓存的高效利用,减少了对数据库的访问次数,提高了查询性能。原创 2025-03-08 16:52:00 · 1017 阅读 · 0 评论 -
mysql之ALTER COLUMN、CHANGE COLUMN、MODIFY COLUMN的区别
mysql之ALTER COLUMN、CHANGE COLUMN、MODIFY COLUMN的区别ALTER COLUMN:设置或删除列的默认值,不会引起表的重构。例子:alter table film alter column rental_duration set default 5; alter table film alter column rental_duration drop default;MODIFY COLUMN:用来修改列的类型和默认值等,会引起表的转载 2022-01-21 13:36:40 · 4715 阅读 · 0 评论 -
Mysql default CURRENT_TIMESTAMP & on update CURRENT_TIMESTAMP区别
public @interface Column { /** * (Optional) The name of the column. Defaults to * the property or field name. */ String name() default ""; /** * (Optional) Whether the column is a unique key. This is a * shortcut..原创 2022-01-21 11:20:34 · 5463 阅读 · 0 评论 -
Cassandra Java Driver Reference 4.11
文档入口:https://docs.datastax.com/en/developer/java-driver/4.11/1 Session Buildimport com.datastax.oss.driver.api.core.CqlSession;import com.datastax.oss.driver.api.core.cql.*;try (CqlSession session = CqlSession.builder().build()) { ...转载 2021-04-24 21:56:12 · 387 阅读 · 1 评论 -
[Cassandra] static column
How are static columns stored internally in cassandra? Can someone please post an example discussing the design implementation of static column in cassandra?Why don't we take a look at the structure of a table with static columns on disk and find out?.转载 2021-04-07 14:26:19 · 163 阅读 · 0 评论 -
Cassandra primary key, composite key, partition key, clustering key 的区别
Difference between partition key, composite key and clustering key in Cassandra?There is a lot of confusion around this, I will try to make it as simple as possible.The primary key is a general concept to indicate one or more columns used to retrie..转载 2021-04-07 14:07:41 · 285 阅读 · 0 评论 -
Update MySql table with reference to the same table.
It seems very easy. As if it can be done by just adding a subquery inside where condition. But it’s not like that.ProblemFor the demonstration, I have created a sample table with some dummy records as below.UPDATE product pSET p.p..转载 2021-01-12 17:33:19 · 151 阅读 · 0 评论 -
How to set a local list/tuple variable in mysql
SET @list = 'a,b,c';SELECT * FROM myTable WHERE FIND_IN_SET(myField, @list) > 0;FIND_IN_SET(str,strlist)Returns a value in the range of 1 toNif the stringstris in the string liststrlistconsisting ofNsubstrings. A string list is a string ...转载 2021-01-12 17:30:05 · 148 阅读 · 0 评论 -
面试总结SQL 经典面试题
原文:https://www.cnblogs.com/yoyoketang/p/10118924.html前言用一条SQL 语句查询xuesheng表每门课都大于80 分的学生姓名,这个是面试考sql的一个非常经典的面试题having和not in查询 xuesheng表每门课都大于80 分的学生姓名name kecheng score 张三 语文 81 张三 数学 73 李四 语文 86 李四 数学 .转载 2020-12-02 11:17:26 · 344 阅读 · 0 评论 -
Mysql 条件函数
1 IFIF(expr1,expr2,expr3)Ifexpr1isTRUE(expr1<> 0andexpr1<> NULL),IF()returnsexpr2. Otherwise, it returnsexpr3.mysql> SELECT IF(1>2,2,3); -> 3mysql> SELECT...原创 2020-03-08 18:55:17 · 361 阅读 · 0 评论 -
hibernate oneToMany 记录重复 和异常org.hibernate.LazyInitializationException: failed to lazily initializ
问题:最近项目中使用hibernate4+spring4进行数据库访问时,发现一个记录下有五个子项目时竟然返回五条重复记录。初始环境:hibernate 每个用户对应一个小组 。user--group(many to one)。group--user(one to many)Group代码片段 @OneToMany(mappedBy="group", fetch=FetchT...转载 2018-08-10 10:33:21 · 673 阅读 · 0 评论 -
Hive 运行模式总结
Hive 基础概念Hive是基于Hadoop的一个数据仓库,Hive能够将SQL语句转化为MapReduce任务进行运行。 Hive架构图分为以下四部分。 1、用户接口 Hive有三个用户接口: 命令行接口(CLI):以命令行的形式输入SQL语句进行数据数据操作 Web界面:通过Web方式进行访问。 Hive的远程服务方式:通过JDBC等...原创 2020-03-15 22:51:14 · 935 阅读 · 0 评论