merge

@Suspendable
@Nullable
abstract fun <T> merge(@NotNull entity: T): T

Merges a single entity in the persistence context in a transaction.

Return

The merged entity.

Parameters

entity

The entity to merge.

Throws

If entity is a primitive type.

If an error occurs during execution.


@Suspendable
@NotNull
abstract fun <T> merge(@NotNull entities: List<T>): List<T>

Merges multiple entities in the persistence context in a single transaction.

Return

The list of merged entities.

Parameters

entities

List of entities to be merged.

Throws

If entities contains any primitive types.

If an error occurs during execution.