Missing CrudRepository#findOne method

后端 未结 5 991
我在风中等你
我在风中等你 2020-12-02 07:00

I am using Spring 5 in my project. Until today there was available method CrudRepository#findOne.

But after downloading latest snapshot it suddenly disappeared! Is t

5条回答
  •  暖寄归人
    2020-12-02 07:54

    A pragmatic transform

    Old way:

    Entity aThing = repository.findOne(1L);
    

    New way:

    Optional aThing = repository.findById(1L);
    

提交回复
热议问题