Error in mybatis mapping .XML File [How to Solve]

In the mybatis framework, the test is carried out in the Dao layer, and the console displays an error: the attribute “resulttype” must be declared for the element type “delete”

The SQL statement of the corresponding. XML file is:

The detailed error messages on the console are:

1. Attribute ‘resulttype’ must be declared for element type ‘Delete’

2.

Check the information on the Internet and say that every_In the sqlmapper.xml file, try to match each SQL statement to a namespace (the complete Java class of each Dao layer); As a result, the attempt was unsuccessful

Finally, simply_Delete the resulttype in the sqlmapper.xml file, and the test is successful; Delete as shown:

Successful test chart:

1 is to get the spring container

2 is the number of deleted data in the test (the number of deleted data in the first test is 1), and this result is the second test

 

Similar Posts: