Find Distinct results in spring data jpa
00:12 05 Mar 2022

Im trying to fetch Distinct records, SQL query looks as follows

select DISTINCT id from Table A where UserId = 'XXXX';

Currently, I have implemented this using spring data jpa @Query

@Query(value = "select DISTINCT id from Table A where UserId = :userId")

Can this be achived through spring data jpa query method ?

spring-boot jpa spring-data-jpa spring-data jpql