I have a Spring Data & JPA QueryDSL based project in which I have many repository interfaces extending QueryDslPredicateExecutor like below:
public interface ProductRepository extends JpaRepository<Product, Long>,
QueryDslPredicateExecutor<Product> {
}
I am performing findAll()
queries with BooleanExpression
s all over my application to fetch data. However I now need to find the distinct results of a query based on a particular column.
I am also using Projections & Custom repositories in some cases to select particular columns based on this post.
Is there a way to select distinct
so that I only get the distinct values of a particular column for a query, based on any of the above approaches?