The self-growing primary key cannot be obtained when SpringBoot+Mybatis+MySQL is inserted

useGeneratedKeys= "true" keyProperty= "id",

   
the primary key is also printed, but it cannot be obtained

.
Apr.01,2021

your primary key is not self-increasing. Set the primary key to grow in your table, or make a unified judgment before inserting. When the primary key is null, set a serialized id


.

personally tested, this is sure to work. Or if you have mistakes in other places, check it out.

Has the problem of

been solved?

Menu