springboot jpa的findOne方法不能传参数id(int)

 

所用版本 springboot v2.4.0 如果要传id可以查询用getOne(),或者findById(id).get()

findById(id).get() ;

 所有根据id操作的方法如下:

如果想要使用此方法传入String和Integer的类型参数,可以降低boot的版本:(1.5.6)

 可以参考这篇博客:  https://blog.csdn.net/qq_41723615/article/details/88365130

 

posted @ 2020-11-15 23:58  Misterj  阅读(277)  评论(0编辑  收藏  举报