Consider the following method on a Spring Data JPA interface:
@Query(\"select distinct :columnName from Item i\") List findByName(@Param(\"columnName
You can use QueryDSL support built into Spring Data. See this tutorial to get started.