I want to fetch List of ids instead of List. How should I define it using JpaRepository syntax? The same code, but I want something like List<Long> ids...
.
Is there a way to do it using JpaRepository without using @Query
?
List<Education> findByUserId(Long userId);
I don't think this is possible. As a workaround you can use a Projection containing only the id.
The repository method: