Package dev.akif.crud.simplest
Class SimplestController<I extends Serializable,E extends SimplestEntity<I,E>,R extends SimplestRepository<I,E>,S extends SimplestService<I,E,R>>
java.lang.Object
dev.akif.crud.CRUDController<I,E,E,E,E,E,E,E,R,S>
dev.akif.crud.simplest.SimplestController<I,E,R,S>
- Type Parameters:
I
- Id type of the dataE
- Entity type of the data which is aSimplestEntity
R
- Repository type of the data which is aSimplestRepository
S
- Service type of the data which is aSimplestService
public abstract class SimplestController<I extends Serializable,E extends SimplestEntity<I,E>,R extends SimplestRepository<I,E>,S extends SimplestService<I,E,R>>
extends CRUDController<I,E,E,E,E,E,E,E,R,S>
The simplest variant of
CRUDController
where the only data model is the entity
This variant is only recommended for very simple data models. Whenever possible, try and use one of the other variants.
This is meant to be extended from a @RestController
class,
ideally also with a @RequestMapping
with some path prefix for the endpoints.
-
Field Summary
Fields inherited from class dev.akif.crud.CRUDController
service, type
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SimplestController
(String type, S service) Constructor to provide type name and dependencies to this controller -
Method Summary
-
Constructor Details
-
SimplestController
Constructor to provide type name and dependencies to this controller- Parameters:
type
- Type name of the data this controller managesservice
- Service dependency of this controller
-
-
Method Details
-
toDTO
Description copied from class:CRUDController
Mapper to convert from model to DTO- Specified by:
toDTO
in classCRUDController<I extends Serializable,
E extends SimplestEntity<I, E>, E extends SimplestEntity<I, E>, E extends SimplestEntity<I, E>, E extends SimplestEntity<I, E>, E extends SimplestEntity<I, E>, E extends SimplestEntity<I, E>, E extends SimplestEntity<I, E>, R extends SimplestRepository<I, E>, S extends SimplestService<I, E, R>> - Parameters:
model
- Model to convert- Returns:
- DTO built from given model
-