CRUDRepository

@NoRepositoryBean
interface CRUDRepository<I : Serializable, E : CRUDEntity<I, E>> : Repository<E, I> (source)

Base interface of a CRUD repository for data layer

This is meant to be implemented from a @Repository interface.

Parameters

I

Id type of the data

E

Entity type of the data which is a CRUDEntity

Functions

Link copied to clipboard
abstract fun findAllByDeletedAtIsNull(pageable: Pageable): Page<E>

Finds all entities for given pagination and deletion flag

Link copied to clipboard
abstract fun findByIdAndDeletedAtIsNull(id: I): E?

Finds an entity with given id and deletion flag

Link copied to clipboard
abstract fun flush()

Flushes changes made to the entities, meaning any change will be persisted.

Link copied to clipboard
@Modifying
abstract fun save(entity: E): E

Saves given entity, used when creating a new entity

Link copied to clipboard
@Modifying
abstract fun updateByVersion(entity: E, version: Int): Int

Updates given entity if it is at given version

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard