文章目录
按照id删除单个记录
接口建方法
void deleteById(int id);
生成映射语句
<delete id="deleteById">
delete from mybatis.brand
where id = #{id}
</delete>
执行代码
@Test
public void testDelById() throws IOException {
String resource = "mybatis-config.xml";
InputStream inputStream = Resources.getResourceAsStream(resource);
SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder(