Home » Tip Bank » Java
  • Comment on this Article
Language: Java
Expertise: Intermediate
Dec 10, 2019

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Watch

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
 
Submit a Tip
Browse "Java" Tips
Browse All Tips
enable-javascript.com
w3schools.com