dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Java
Expertise: Intermediate
Dec 10, 2019

How to Selectively Expose CRUD Operations

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

@NoRepositoryBean
interface IntermediateRepository extends Repository {

   //  add here the selected CRUD, for example we add only findOne()

   T findOne(ID id);
}

Further, write your repository as follows:

@Repository
interface ProductRepository extends IntermediateRepository {
  // only findOne() is visible
}
Octavia Anghel
 
Thanks for your registration, follow us on our social networks to keep up-to-date