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
We had many hundreds of usages of the old findOne()
method. Rather than embark on a mammoth refactor, we ended up creating the following intermediary interface and had our repositories extend it instead of extending JpaRepository
directly
@NoRepositoryBean
public interface BaseJpaRepository extends JpaRepository {
default T findOne(ID id) {
return (T) findById(id).orElse(null);
}
}