feature request to automate and speed up Creating CRUD Controllers and Services the problem I'm facing is that every time i have to start a new project i have to rewrite some CRUD logic into the Service Layer and The Controller Layer so I could follow the MVC architecture I think it's time to have a Basic CrudService Class and CrudController class so we could inherit those classes functionality without the need to rewrite the CRUD Logic every time. for example :

@RestController
@RequestMapping("/api/entity1")
public class Entity1Controller extends BaseCrudController<Entity1Service, Entity1> {

private final Entity1Service service;

public Entity1Controller(Entity1Service service) {
    super(service);
    this.service=service;
    // TODO Auto-generated constructor stub
}

}

the BaseCrudController in this example is an abstract class that with the @RequestMapping annotation and the @RestController annotation it gives us the CRUD operation without writing theme based on the service class and the Entity. for this example when we run the application we get /api/entity1/get/id , /api/entity1/all and more out of the box. the same logic for the a BaseCrudService class

@Service
public class Entity1Service extends BaseCrudService<Entity1Repository, Entity1> {

private final Entity1Repository repository;

public Entity1Service(Entity1Repository repository) {
    super(repository);
    this.repository=repository;
    // TODO Auto-generated constructor stub
}

we get a basic service based on the Entity and the Repository for that Entity.

an implementation can be found on this repository and a complete project for more information. thank you for reading this until the end.

Comment From: wilkinsona

Thanks for the suggestion but functionality like this is already provided by Spring Data REST.