SpringData: filtering fields of Entity in Repository
I think that this is not a good practice, but it still may be acceptable in some situations.

The reasons to avoid this:

1) default methods are not intended to introduce new functionality, but rather to provide backwards compatibility for older APIs. The official tutorial says:


  Default methods enable you to add new functionality to the interfaces of your libraries and ensure binary compatibility with code written for older versions of those interfaces.


2) It looks like you are using JPA. In a Spring repository, you can achieve the same result by using @Query, without detailing the implementation:

@Query("SELECT DISTINCT ol.addresses FROM OfficeLocation ol ...") // TODO complete the HQL
List&lt;Address&gt; findOfficeLocations();


3) If it cannot be done with a query, you are right, a better place for it is a service.