2

I want to allow only reading operations on my JpaRepository.

I found a related post but it seems to tackle only the case of a simple Repository:

public interface ReadOnlyRepository<T, ID extends Serializable> extends Repository<T, ID> {

  T findOne(ID id);

  Iterable<T> findAll();
}

What I need instead, is to apply the same but for my JpaRepository or PagingAndSortingRepository.

The reason is I want my read-only repo to support Paging.

So, how I can make a read/write-only JpaRepository or PagingAndSortingRepository?

(using Spring Boot 2.3.1)

arxakoulini
  • 723
  • 7
  • 22

0 Answers0