SimplestEntity

abstract class SimplestEntity<I : Serializable, E : CRUDEntity<I, E>>(var id: I?, var version: Int?, var createdAt: Instant?, var updatedAt: Instant?, var deletedAt: Instant?) : CRUDEntity<I, E> , CRUDModel<I> , CRUDCreateModel, CRUDUpdateModel, CRUDDTO<I> , CRUDCreateDTO, CRUDUpdateDTO(source)

Simpler variant of CRUDEntity which is also a CRUDModel, a CRUDCreateModel, a CRUDUpdateModel, a CRUDDTO, a CRUDCreateDTO and a CRUDUpdateDTO

Parameters

I

Id type of the data

E

Entity type which is also a CRUDCreateModel, a CRUDUpdateModel, a CRUDCreateDTO and a CRUDUpdateDTO, meant to be the exact type extending this class

Constructors

Link copied to clipboard
fun <I : Serializable> SimplestEntity(id: I?, version: Int?, createdAt: Instant?, updatedAt: Instant?, deletedAt: Instant?)

Properties

Link copied to clipboard
open override var createdAt: Instant?

Instant at which this entity is created

Link copied to clipboard
open override var deletedAt: Instant?

Instant at which this entity is logically deleted or null if is not deleted, deleted entities should be treated as if they don't exist at all

Link copied to clipboard
open override var id: I?

Identifier of this entity

Link copied to clipboard
open override var updatedAt: Instant?

Instant at which this entity is last updated

Link copied to clipboard
open override var version: Int?

Version of this entity used in optimistic locking during persistence

Functions

Link copied to clipboard
open override fun createdAt(): Instant

Gets the instant at which this model is created

Link copied to clipboard
open override fun deletedAt(): Instant?

Gets the instant at which this model is deleted

Link copied to clipboard
open override fun id(): I

Gets identifier of this model

Link copied to clipboard
open override fun updatedAt(): Instant

Gets the instant at which this model is last updated

Link copied to clipboard
open override fun version(): Int

Gets version of this model

Inherited functions

Link copied to clipboard

Marks this entity as deleted at given time, also setting updated at and incrementing its version

Link copied to clipboard

Marks this entity as updated at given time, also incrementing its version