For example, there are three fields: Table person, person, id (mysql database, primary key, non-auto-increment), and name and pswd. In the case of auto-increment, we usually process insertintoperson (name, pswd) values (# {name}, # {pswd}) in this way. you are not allowed to insert a primary key, because the primary keys of the person table are auto-incrementing. But what if the primary key does not grow? How to handle it. If the primary key is not auto-incrementing, the primary key must be inserted. When modifying the table structure in a step! I can think of two ways to solve this problem: one is to achieve auto-growth when the primary key is inserted, for example, the first primary key to insert 1,... mysqlmybatis data
For example, there are three fields: Table person, person, id (mysql database, primary key, non-auto-increment), and name and pswd. This is usually the case for auto-increment.
Insert into person (name, pswd) values (# {name}, # {pswd })
In this case, you are not allowed to insert a primary key because the primary key of the person table is auto-incrementing. But what if the primary key does not grow? How to handle it. If the primary key is not auto-incrementing, the primary key must be inserted.
When modifying the table structure in a step! I can think of two ways to solve this problem. one is to achieve auto-growth when the primary key is inserted, for example, the first primary key is inserted into 1 and the second is inserted into 2. this method is not very good. The second is whether mapper. xml can achieve self-growth like the oracle sequence, and the younger brother is not capable enough. I hope you can give me more advice. If you have better methods, please point out.