Mybatis inserts one or batch inserts and returns instances with self growing primary key records
•
Java
First of all, the version of mybatis that inserts a record and returns the primary key needs to be upgraded to 3.3 Version 1, 3.3 Not before 0.
1.MysqL
The use of a single item is the same as that of multiple items, and usegeneratedkeys = "true" keyproperty = "primary key field" is added
2.Oracle
The above example of mybatis inserting one or batch inserting and returning records with self growing primary key is all the content shared by Xiaobian. I hope it can give you a reference and support more programming tips.
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码