Is it possible to create read-only repositories using Spring Data?
I have some entities linked to views and some child entities for which I would like to provide a r
To expand on Oliver Gierke's answer, in the more recent versions of Spring Data you will need the @NoRepositoryBean annotation on your ReadOnlyRepository (parent interface) to prevent application start up errors:
import org.springframework.data.repository.NoRepositoryBean;
import org.springframework.data.repository.Repository;
@NoRepositoryBean
public interface ReadOnlyRepository extends Repository {
T findOne(ID id);
List findAll();
}