Select Distinct columns from table JPA
<p>I was wondering if there was a way using JPA query (not sure what the word I'm looking for is sorry). </p>

<pre><code>@Transactional
public interface UserRepository extends JpaRepository&lt;User, Long&gt; {


    List&lt;User&gt; findByLastNameIgnoreCase(String lastName); //This is the format I am looking for

    @Query("SELECT DISTINCT t.lastName FROM User t") //Don't want to have to use the @Query 
    List&lt;String&gt; findDistinctLastNames();

}
</code></pre>

<p>Hopefully that makes it more clear. But I am trying to perform that Query without having to use the @Query. It doesn't really affect anything having it there, I would just like it. Is that statement possible? </p>