MyBatis-05-DML: additions and deletions;


 

Since the additions and deletions to the data will change, so we have to carry out the transaction;

A. To increase the operating

layer mapper xml file code:

 

 

Test Method Test class code:

 

 

 

 Must pay attention to, MyBatis transaction commit is off by default, we want to commit the transaction using sessin target commit method is called;

 

 

II. Update

layer mapper xml file code:

 

 

 Test Method Test class codes:

 

 

 

 

III. Delete operation

Guess you like

Origin www.cnblogs.com/EricShen/p/11740850.html