devxlogo

How to Selectively Expose CRUD Operations

How to Selectively Expose CRUD Operations

In order to selectively expose CRUD operations, we need to define an intermediate interface, annotated as below:

@NoRepositoryBeaninterface IntermediateRepository extends Repository {   //  add here the selected CRUD, for example we add only findOne()   T findOne(ID id);}

Further, write your repository as follows:

@Repositoryinterface ProductRepository extends IntermediateRepository {  // only findOne() is visible}

devx-admin

Share the Post: