当前位置:网站首页>The new MySQL table has a self increasing ID of 20 bits. The reason is
The new MySQL table has a self increasing ID of 20 bits. The reason is
2022-04-23 16:48:00 【A coir boat in the broken white clouds】
since mybaitis-plus Appearance , We are used to automatically generating code , Although it saves a lot of development time , But it's also easy to ignore some details .
In a business operation , I need to add a table a And table b The data of , surface a Add normal , surface b It opened my eyes
I don't understand , So I went online to find a solution .
Scheme 1 :
TRUNCATE TABLE tablename
Da baa !
Option two :
Da baa !
So I tried to add a piece of data to the database :
This shows that it is not a database problem , That's my code !
By a colleague , Then enter the entity class to view :
No problem , Then go to code logic , Found my watch a The entity class of does not add
type = IdType.Auto
Selfishness is not the problem , Because my watch a The addition of data is very normal , What's not normal is the watch b, But I still treat a dead horse as a living horse doctor , Restart the project with a try mentality , add to , success 了 !
Milk thought ~
ps: If... Is not specified when defining the entity class @TableId(type=IdType.AUTO), that mybatisPlus Will id The type of is set to IdType.NONE, Use the snowflake algorithm to automatically help you set id Well ~
A thousand Li dike , Collapse in ant nest , I hope everyone will not be defeated by small details
版权声明
本文为[A coir boat in the broken white clouds]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231400068490.html
边栏推荐
- Camtasia2022软件新增功能介绍
- Set the color change of interlaced lines in cells in the sail software and the font becomes larger and red when the number is greater than 100
- Gartner 发布新兴技术研究:深入洞悉元宇宙
- Introduction to new functions of camtasia2022 software
- [pimf] openharmony paper Club - what is the experience of wandering in ACM survey
- 扫码登录的原理你真的了解吗?
- File system read and write performance test practice
- 无线鹅颈麦主播麦手持麦无线麦克风方案应当如何选择
- Regular filtering of Intranet addresses and segments
- Easyexcel reads the geographical location data in the excel table and sorts them according to Chinese pinyin
猜你喜欢
Gartner 发布新兴技术研究:深入洞悉元宇宙
ByteVCharts可视化图表库,你想要的我都有
How much do you know about the process of the interview
Ali developed three sides, and the interviewer's set of combined punches made me confused on the spot
Use case execution of robot framework
Nifi fast installation and file synchronization
PyTorch:train模式与eval模式的那些坑
MySQL master-slave synchronization pit avoidance version tutorial
Dlib of face recognition framework
Real time operation of vim editor
随机推荐
如何用Redis实现分布式锁?
Solution of garbled code on idea console
MySQL master-slave synchronization pit avoidance version tutorial
Pycham connects to the remote server and realizes remote debugging
An essay on the classical "tear down the wall in thinking"
面试百分百问到的进程,你究竟了解多少
Introduction to new functions of camtasia2022 software
Detailed explanation of file operation (2)
◰GL-着色器处理程序封装
Public variables of robotframework
杂文 谈谈古典的《拆掉思维里的墙》
LVM与磁盘配额
深入了解3D模型相关知识(建模、材质贴图、UV、法线),置换贴图、凹凸贴图与法线贴图的区别
Do you really understand the principle of code scanning login?
DanceNN:字节自研千亿级规模文件元数据存储系统概述
∑GL-透视投影矩阵的推导
LVM and disk quota
计算饼状图百分比
英语 | Day15、16 x 句句真研每日一句(从句断开、修饰)
文件操作详解(2)