SimplestService

abstract class SimplestService<I : Serializable, E : SimplestEntity<I>, out R : SimplestRepository<I, E>, out Mapper : SimplestMapper<I, E>>(typeName: String, instantProvider: InstantProvider, crudRepository: CRUDRepository<I, E>, mapper: Mapper) : CRUDService<I, E, E, E, E, R, Mapper> (source)

The simplest variant of CRUDService where models are entities directly

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 SimplestEntity

R

Repository type of the data which is a SimplestRepository

Mapper

Mapper type of the data which is a SimplestMapper

Constructors

Link copied to clipboard
fun <I : Serializable, E : SimplestEntity<I>, out Mapper : SimplestMapper<I, E>> SimplestService(typeName: String, instantProvider: InstantProvider, crudRepository: CRUDRepository<I, E>, mapper: Mapper)

Inherited functions

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

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): E?

Default implementation for getting an entity with given id

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

Default implementation for listing entities with given pagination

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

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