Package dev.akif.crud.simplest
Class SimplestService<I extends Serializable,E extends SimplestEntity<I,E>,R extends SimplestRepository<I,E>>
java.lang.Object
dev.akif.crud.CRUDService<I,E,E,E,E,R>
dev.akif.crud.simplest.SimplestService<I,E,R>
- Type Parameters:
I- Id type of the dataE- Entity type of the data which is aSimplestEntityR- Repository type of the data which is aSimplestRepository
public abstract class SimplestService<I extends Serializable,E extends SimplestEntity<I,E>,R extends SimplestRepository<I,E>>
extends CRUDService<I,E,E,E,E,R>
The simplest variant of
CRUDService where models are entities directly
This is meant to be extended from a Service class.
-
Field Summary
Fields inherited from class dev.akif.crud.CRUDService
clock, repository, type -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimplestService(String type, Clock clock, R repository) Constructor to provide type name and dependencies to this service -
Method Summary
-
Constructor Details
-
SimplestService
Constructor to provide type name and dependencies to this service- Parameters:
type- Type name of the data this service managesclock-Clockdependency of this servicerepository- Repository dependency of this service
-
-
Method Details
-
toModel
Description copied from class:CRUDServiceMapper to convert from entity to model- Specified by:
toModelin classCRUDService<I extends Serializable,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>> - Parameters:
entity- Entity to convert- Returns:
- Model built from given entity
-