How to return just the primary key of the following JPA entity instead of the entire object in findByName method
public interface FooRepository extends JpaRepository<Foo, Long> {
    Optional<Foo> findByName(String name);
}
How to return just the primary key of the following JPA entity instead of the entire object in findByName method
public interface FooRepository extends JpaRepository<Foo, Long> {
    Optional<Foo> findByName(String name);
}
