Remember a savebatch null pointer exception

1. Environment: sqlserver+mybatisplus+java+idea

2. Background: When importing data, use savebatch of mybatisplus to batch import and report a null pointer exception

3. Debugging steps:

1. Look at the abnormal information printed on the console

2. Savebatch is a built-in method, and the source code needs to be tracked

3. Breakpoint at the top code line of the exception message, and breakpoint at the error line of the savebatch method of iphelper

4. Look at the detailed information of the exception thrown by the error line code

4. Reasons:

Because the table field set is a keyword, tablefield(value='set') is added to the entity class set, which is wrong, and it should be written as [set] in sqlserver

(End of full text)

Guess you like

Origin blog.csdn.net/humors221/article/details/115365490