Mybatis学习第7节 -- 删除
接口
int deleteShopById(int id);
|
映射
<delete id="deleteShopById">
|
测试
@Test
|
结果
Opening JDBC Connection Created connection 858423246. Setting autocommit to false on JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@332a7fce] ==> Preparing: DELETE FROM `tb_shop` WHERE `shop_id` = ? ==> Parameters: 42(Integer) <== Updates: 1 Committing JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@332a7fce] Resetting autocommit to true on JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@332a7fce] Closing JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@332a7fce] Returned connection 858423246 to pool. 删除结果: 1 |