SimplerService

abstract class SimplerService<I : Serializable, E : SimplerEntity<I>, M : SimplerModel<I>, out R : SimplerRepository<I, E>, out Mapper : SimplerMapper<I, E, M>>(typeName: String, instantProvider: InstantProvider, crudRepository: CRUDRepository<I, E>, mapper: Mapper) : CRUDService<I, E, M, M, M, R, Mapper> (source)

Simpler variant of CRUDService where create/update models are just models

This is meant to be extended from a @Service class.

Parameters

I

Id type of the data

E

Entity type of the data which is a SimplerEntity

M

Model type of the data which is a SimplerModel

R

Repository type of the data which is a SimplerRepository

Mapper

Mapper of the data which is a SimplerMapper

Constructors

Link copied to clipboard
fun <I : Serializable, E : SimplerEntity<I>, out Mapper : SimplerMapper<I, E, M>> SimplerService(typeName: String, instantProvider: InstantProvider, crudRepository: CRUDRepository<I, E>, mapper: Mapper)

Inherited functions

Link copied to clipboard
@Transactional
open fun create(createModel: M): M

Default implementation for creating a new entity from given create model

Link copied to clipboard
@Transactional
open fun delete(id: I)

Default implementation for deleting an entity with given id

Link copied to clipboard
open fun get(id: I): M?

Default implementation for getting an entity with given id

Link copied to clipboard
open fun getAll(pageable: Pageable): Paged<M>

Default implementation for listing entities with given pagination

Link copied to clipboard
@Transactional
open fun update(id: I, updateModel: M): M

Default implementation for updating an entity with given id with given update model data