博主首页

jpa不写sql,也不写查询

 

 

 JPA的计数查询

 这种格式的查询 可以不用写sql

 int countBySupEngCode(String supEngCode);
  • 确认你的dao层继承的是JpaRepository
  • countByOpenIdAndStatus【count,By,And】是固定格式哦
  • 返回值一定是int,否则会报错的
posted @ 2022-01-21 11:04  笑~笑  阅读(204)  评论(0)    收藏  举报