当前位置:网站首页>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
边栏推荐
- True math problems in 1959 college entrance examination
- Use case execution of robot framework
- 05 Lua control structure
- Mock test using postman
- loggie 源码分析 source file 模块主干分析
- Copy constructor shallow copy and deep copy
- What is homebrew? And use
- Kunteng full duplex digital wireless transceiver chip kt1605 / kt1606 / kt1607 / kt1608 is suitable for interphone scheme
- Zhongang Mining: Fluorite Flotation Process
- File upload and download of robot framework
猜你喜欢
Sail soft implements a radio button, which can uniformly set the selection status of other radio buttons
Installing labellmg tutorial in Windows
Modify the test case name generated by DDT
Bytevcharts visual chart library, I have everything you want
New project of OMNeT learning
计组 | 【七 输入/输出系统】知识点与例题
Set cell filling and ranking method according to the size of the value in the soft report
vim编辑器的实时操作
Detailed explanation of file operation (2)
1959年高考数学真题
随机推荐
PHP高效读大文件处理数据
文件操作详解(2)
Database dbvisualizer Pro reported file error, resulting in data connection failure
Qipengyuan horizon credible meta universe social system meets diversified consumption and social needs
Modify the test case name generated by DDT
VMware Workstation cannot connect to the virtual machine. The system cannot find the specified file
[pimf] openharmony paper Club - what is the experience of wandering in ACM survey
Xinwangda: HEV and Bev super fast charging fist products are shipped on a large scale
Do you really understand the principle of code scanning login?
Pycham connects to the remote server and realizes remote debugging
【Pygame小游戏】10年前风靡全球的手游《愤怒的小鸟》,是如何霸榜的?经典回归......
【PIMF】OpenHarmony啃论文俱乐部—在ACM Survey闲逛是什么体验
Construction of promtail + Loki + grafana log monitoring system
文件系统读写性能测试实战
Redis "8" implements distributed current limiting and delay queues
杂文 谈谈古典的《拆掉思维里的墙》
What is homebrew? And use
Report FCRA test question set and answers (11 wrong questions)
How does flash cache data in memory?
◰ GL shader handler encapsulation