BaseSagaRepository

@NoRepositoryBean
interface BaseSagaRepository<T : BaseSaga<T>> : JpaRepository<T, String> , SagaRepositoryPort<T> (source)

JPA flavor of SagaRepositoryPort. Concrete service repositories extend this interface, and Spring Data JPA generates implementations that simultaneously satisfy the persistence-agnostic port.

Adding a new persistence flavor (e.g. MongoDB) only requires implementing SagaRepositoryPort directly with the target technology — the saga engine is unchanged.

Functions

Link copied to clipboard
abstract fun count(): Long
abstract fun <S : T?> count(example: Example<S?>?): Long
Link copied to clipboard
abstract fun delete(entity: T?)
Link copied to clipboard
abstract fun deleteAll()
abstract fun deleteAll(entities: Iterable<out T?>?)
Link copied to clipboard
abstract fun deleteAllById(ids: Iterable<out String?>?)
Link copied to clipboard
abstract fun deleteAllByIdInBatch(ids: Iterable<String?>?)
Link copied to clipboard
abstract fun deleteAllInBatch()
abstract fun deleteAllInBatch(entities: Iterable<T?>?)
Link copied to clipboard
abstract fun deleteById(id: String?)
Link copied to clipboard
open fun deleteInBatch(entities: Iterable<T?>?)
Link copied to clipboard
abstract fun <S : T?> exists(example: Example<S?>?): Boolean
Link copied to clipboard
abstract fun existsById(id: String?): Boolean
Link copied to clipboard
abstract fun findAll(): List<T?>?
abstract fun findAll(pageable: Pageable?): Page<T?>?
abstract fun findAll(sort: Sort?): List<T?>?
abstract fun <S : T?> findAll(example: Example<S?>?): List<S?>?
abstract fun <S : T?> findAll(example: Example<S?>?, pageable: Pageable?): Page<S?>?
abstract fun <S : T?> findAll(example: Example<S?>?, sort: Sort?): List<S?>?
Link copied to clipboard
abstract fun findAllById(ids: Iterable<String?>?): List<T?>?
Link copied to clipboard
abstract fun <S : T?, R> findBy(example: Example<S?>?, queryFunction: Function<FluentQuery.FetchableFluentQuery<S?>?, R?>?): R?
Link copied to clipboard
abstract fun findById(id: String?): Optional<T?>?
Link copied to clipboard
abstract override fun findByStartedAtBefore(startedAt: Instant): List<T>

Returns sagas whose Saga.startedAt is strictly before startedAt.

Link copied to clipboard
abstract override fun findByStatus(status: SagaStatus): List<T>

Returns all sagas currently in the given SagaStatus.

Link copied to clipboard
abstract override fun findByStatusInAndStartedAtBefore(statuses: List<SagaStatus>, startedAt: Instant): List<T>

Returns sagas in any of statuses whose Saga.startedAt is strictly before startedAt.

Link copied to clipboard
abstract override fun findByStatusInAndUpdatedAtBefore(statuses: List<SagaStatus>, updatedAt: Instant): List<T>

Finds sagas whose Saga.status is in statuses and whose Saga.updatedAt is strictly before updatedAt. Used by the saga watchdog to detect AWAITING_RESPONSE timeouts and to schedule compensation retries with a cooldown.

Link copied to clipboard
abstract override fun findByType(type: String): List<T>

Returns all sagas of the given Saga.type.

Link copied to clipboard
abstract override fun findByTypeAndStatus(type: String, status: SagaStatus): List<T>

Returns sagas matching both type and status.

Link copied to clipboard
abstract fun <S : T?> findOne(example: Example<S?>?): Optional<S?>?
Link copied to clipboard
open override fun findOneById(id: String): T?

Looks up a saga by its Saga.id; null if absent.

Link copied to clipboard
abstract fun flush()
Link copied to clipboard
abstract fun getById(id: String?): T?
Link copied to clipboard
abstract fun getOne(id: String?): T?
Link copied to clipboard
abstract fun getReferenceById(id: String?): T?
Link copied to clipboard
abstract fun save(saga: T): T

Persists saga (insert or update) and returns the stored instance.

abstract fun <S : T?> save(entity: S?): S?
Link copied to clipboard
abstract fun <S : T?> saveAll(entities: Iterable<S?>?): List<S?>?
Link copied to clipboard
abstract fun <S : T?> saveAllAndFlush(entities: Iterable<S?>?): List<S?>?
Link copied to clipboard
abstract fun <S : T?> saveAndFlush(entity: S?): S?