创建接口:Student selectById(int id);

一、映射文件——SQL语句:

MyBatis:根据id查询

说明:这里的resultType必须要有,属性为bean的全限定性类名,作用是为了封装对象

二、测试类:

MyBatis:根据id查询

三、结果:

MyBatis:根据id查询

相关文章:

  • 2021-08-22
  • 2022-02-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-13
  • 2022-02-06
  • 2022-12-23
  • 2022-01-11
  • 2021-07-26
  • 2021-06-18
相关资源
相似解决方案