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}
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist