KEntities

interface KEntities : KSaver

To be absolutely cache friendly, all query methods in this class that start with "find" ignore the global filters.

The mentions here ignore global filters, only for aggregate root objects, excluding deeper objects fetched by object fetcher.

Functions

Link copied to clipboard
abstract fun delete(type: KClass<*>, id: Any, con: Connection? = null, block: KDeleteCommandDsl.() -> Unit? = null): KDeleteResult
Link copied to clipboard
abstract fun deleteAll(type: KClass<*>, ids: Iterable<*>, con: Connection? = null, block: KDeleteCommandDsl.() -> Unit? = null): KDeleteResult
Link copied to clipboard
abstract fun <T : Any> findAll(type: KClass<T>): List<T>
abstract fun <T : Any> findAll(type: KClass<T>, block: SortDsl<T>.() -> Unit? = null): List<T>
abstract fun <E : Any> findAll(fetcher: Fetcher<E>, block: SortDsl<E>.() -> Unit? = null): List<E>
Link copied to clipboard
abstract fun <E : Any, V : View<E>> findAllViews(view: KClass<V>, block: SortDsl<E>.() -> Unit? = null): List<V>
Link copied to clipboard
abstract fun <E : Any, V : View<E>> findByExample(viewType: KClass<V>, example: KExample<E>, block: SortDsl<E>.() -> Unit? = null): List<V>
abstract fun <E : Any> findByExample(example: KExample<E>, fetcher: Fetcher<E>? = null, block: SortDsl<E>.() -> Unit? = null): List<E>
Link copied to clipboard
abstract fun <T : Any> findById(type: KClass<T>, id: Any): T?
abstract fun <E : Any> findById(fetcher: Fetcher<E>, id: Any): E?
Link copied to clipboard
abstract fun <T : Any> findByIds(type: KClass<T>, ids: Iterable<*>): List<T>
abstract fun <E : Any> findByIds(fetcher: Fetcher<E>, ids: Iterable<*>): List<E>
Link copied to clipboard
abstract fun <ID, T : Any> findMapByIds(type: KClass<T>, ids: Iterable<ID>): Map<ID, T>
abstract fun <ID, E : Any> findMapByIds(fetcher: Fetcher<E>, ids: Iterable<ID>): Map<ID, E>
Link copied to clipboard
abstract fun <T : Any> findOneById(type: KClass<T>, id: Any): T
abstract fun <E : Any> findOneById(fetcher: Fetcher<E>, id: Any): E
Link copied to clipboard
@NewChain
abstract fun forConnection(con: Connection?): KEntities
Link copied to clipboard
@NewChain
abstract fun forUpdate(): KEntities
Link copied to clipboard
open fun <E : Any> insert(entity: E, associatedMode: AssociatedSaveMode = AssociatedSaveMode.APPEND, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KSimpleSaveResult<E>

Insert an entity object

open fun <E : Any> insert(input: Input<E>, associatedMode: AssociatedSaveMode = AssociatedSaveMode.APPEND, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KSimpleSaveResult<E>

Insert an input DTO

Link copied to clipboard
open fun <E : Any> insertEntities(entities: Iterable<E>, associatedMode: AssociatedSaveMode = AssociatedSaveMode.APPEND, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KBatchSaveResult<E>
Link copied to clipboard
open fun <E : Any> insertEntitiesIfAbsent(entities: Iterable<E>, associatedMode: AssociatedSaveMode = AssociatedSaveMode.APPEND_IF_ABSENT, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KBatchSaveResult<E>
Link copied to clipboard
open fun <E : Any> insertIfAbsent(entity: E, associatedMode: AssociatedSaveMode = AssociatedSaveMode.APPEND_IF_ABSENT, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KSimpleSaveResult<E>

Insert an entity object if necessary, if the entity object exists in database, ignore it.

open fun <E : Any> insertIfAbsent(input: Input<E>, associatedMode: AssociatedSaveMode = AssociatedSaveMode.APPEND_IF_ABSENT, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KSimpleSaveResult<E>

Insert an input DTO if necessary, that means to convert the input DTO to entity object and save it. If the entity object exists in database, ignore it.

Link copied to clipboard
open fun <E : Any> insertInputs(inputs: Iterable<Input<E>>, associatedMode: AssociatedSaveMode = AssociatedSaveMode.APPEND, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KBatchSaveResult<E>
Link copied to clipboard
open fun <E : Any> insertInputsIfAbsent(inputs: Iterable<Input<E>>, associatedMode: AssociatedSaveMode = AssociatedSaveMode.APPEND_IF_ABSENT, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KBatchSaveResult<E>
Link copied to clipboard
open fun <E : Any> merge(entity: E, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KSimpleSaveResult<E>

Merge an entity object

open fun <E : Any> merge(input: Input<E>, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KSimpleSaveResult<E>

Merge an input DTO

Link copied to clipboard
open fun <E : Any> mergeEntities(entities: Iterable<E>, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KBatchSaveResult<E>
Link copied to clipboard
open fun <E : Any> mergeInputs(inputs: Iterable<Input<E>>, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KBatchSaveResult<E>
Link copied to clipboard
abstract fun <E : Any> save(entity: E, con: Connection? = null, block: KSaveCommandDsl.() -> Unit? = null): KSimpleSaveResult<E>
open fun <E : Any> save(entity: E, associatedMode: AssociatedSaveMode, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KSimpleSaveResult<E>
open fun <E : Any> save(entity: E, mode: SaveMode, associatedMode: AssociatedSaveMode = AssociatedSaveMode.REPLACE, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KSimpleSaveResult<E>

Save an entity object

open fun <E : Any> save(input: Input<E>, con: Connection? = null, block: KSaveCommandDsl.() -> Unit? = null): KSimpleSaveResult<E>
open fun <E : Any> save(input: Input<E>, associatedMode: AssociatedSaveMode, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KSimpleSaveResult<E>
open fun <E : Any> save(input: Input<E>, mode: SaveMode, associatedMode: AssociatedSaveMode = AssociatedSaveMode.REPLACE, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KSimpleSaveResult<E>

Save an input DTO

Link copied to clipboard
abstract fun <E : Any> saveEntities(entities: Iterable<E>, con: Connection? = null, block: KSaveCommandDsl.() -> Unit? = null): KBatchSaveResult<E>
open fun <E : Any> saveEntities(entities: Iterable<E>, associatedMode: AssociatedSaveMode, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KBatchSaveResult<E>
open fun <E : Any> saveEntities(entities: Iterable<E>, mode: SaveMode, associatedMode: AssociatedSaveMode = AssociatedSaveMode.REPLACE, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KBatchSaveResult<E>

Save some entity objects

Link copied to clipboard
open fun <E : Any> saveInputs(inputs: Iterable<Input<E>>, con: Connection? = null, block: KSaveCommandDsl.() -> Unit? = null): KBatchSaveResult<E>
open fun <E : Any> saveInputs(inputs: Iterable<Input<E>>, associatedMode: AssociatedSaveMode, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KBatchSaveResult<E>
open fun <E : Any> saveInputs(inputs: Iterable<Input<E>>, mode: SaveMode, associatedMode: AssociatedSaveMode = AssociatedSaveMode.REPLACE, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KBatchSaveResult<E>

Save some input DTOs

Link copied to clipboard
open fun <E : Any> update(entity: E, associatedMode: AssociatedSaveMode = AssociatedSaveMode.UPDATE, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KSimpleSaveResult<E>

Update an entity object

open fun <E : Any> update(input: Input<E>, associatedMode: AssociatedSaveMode = AssociatedSaveMode.UPDATE, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KSimpleSaveResult<E>

Update an input DTO

Link copied to clipboard
open fun <E : Any> updateEntities(entities: Iterable<E>, associatedMode: AssociatedSaveMode = AssociatedSaveMode.UPDATE, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KBatchSaveResult<E>
Link copied to clipboard
open fun <E : Any> updateInputs(inputs: Iterable<Input<E>>, associatedMode: AssociatedSaveMode = AssociatedSaveMode.UPDATE, con: Connection? = null, block: KSaveCommandPartialDsl.() -> Unit? = null): KBatchSaveResult<E>