当前位置:网站首页>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
边栏推荐
猜你喜欢

OMNeT学习之新建工程

VMware Workstation cannot connect to the virtual machine. The system cannot find the specified file

JMeter installation tutorial and solutions to the problems I encountered

Set cell filling and ranking method according to the size of the value in the soft report

Disk management and file system

批量制造测试数据的思路,附源码

各大框架都在使用的Unsafe类,到底有多神奇?

安装及管理程序

Install MySQL on MAC

1959年高考数学真题
随机推荐
Pytorch: the pit between train mode and eval mode
计算饼状图百分比
如何用Redis实现分布式锁?
Nacos detailed explanation, something
RAID磁盘阵列与RAID5的创建
正则过滤内网地址和网段
JIRA screenshot
阿里研发三面,面试官一套组合拳让我当场懵逼
Use if else to judge in sail software - use the title condition to judge
On the security of key passing and digital signature
Set cell filling and ranking method according to the size of the value in the soft report
Introduction to new functions of camtasia2022 software
1959年高考数学真题
Dancenn: overview of byte self-developed 100 billion scale file metadata storage system
05 Lua 控制结构
How to build tiktok user trust and drive fan growth
LVM与磁盘配额
English | day15, 16 x sentence true research daily sentence (clause disconnection, modification)
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