Interface JpaStoredEventRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<StoredEvent,
,Long> org.springframework.data.jpa.repository.JpaRepository<StoredEvent,
,Long> org.springframework.data.repository.ListCrudRepository<StoredEvent,
,Long> org.springframework.data.repository.ListPagingAndSortingRepository<StoredEvent,
,Long> org.springframework.data.repository.PagingAndSortingRepository<StoredEvent,
,Long> org.springframework.data.repository.query.QueryByExampleExecutor<StoredEvent>
,Repository<StoredEvent,
,Long> org.springframework.data.repository.Repository<StoredEvent,
,Long> StoredEventRepository
public interface JpaStoredEventRepository
extends StoredEventRepository, org.springframework.data.jpa.repository.JpaRepository<StoredEvent,Long>
A Spring Data JPA "implementation" of the
StoredEventRepository
interface.- Author:
- RealLifeDeveloper
-
Method Summary
Modifier and TypeMethodDescriptionallEventsBetween
(long firstStoredEventId, long lastStoredEventId) Gives allStoredEvents
with IDs greater than or equal tofirstStoredEventId
and less than or equal tolastStoredEventId
, i.e., all events that occurred between the events with the given IDs, inclusive.allEventsSince
(long firstStoredEventId) Gives allStoredEvents
with IDs greater thanstoredEventId
, i.e., all events that occurred after the event with the given ID.Gives the ID of the most recently savedStoredEvent
in the repository.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush
Methods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAll
Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAll
Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAll
Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
Methods inherited from interface com.reallifedeveloper.common.domain.Repository
findById
Methods inherited from interface com.reallifedeveloper.common.application.eventstore.StoredEventRepository
save
-
Method Details
-
allEventsSince
@Query("select se from StoredEvent se where se.id > :firstStoredEventId") List<StoredEvent> allEventsSince(@Param("firstStoredEventId") long firstStoredEventId) Description copied from interface:StoredEventRepository
Gives allStoredEvents
with IDs greater thanstoredEventId
, i.e., all events that occurred after the event with the given ID.- Specified by:
allEventsSince
in interfaceStoredEventRepository
- Parameters:
firstStoredEventId
- find all events with IDs greater than this- Returns:
- a list of
StoredEvents
with IDs greater than or equal tofirstStoredEventId
-
allEventsBetween
@Query("select se from StoredEvent se where se.id between :firstStoredEventId and :lastStoredEventId") List<StoredEvent> allEventsBetween(@Param("firstStoredEventId") long firstStoredEventId, @Param("lastStoredEventId") long lastStoredEventId) Description copied from interface:StoredEventRepository
Gives allStoredEvents
with IDs greater than or equal tofirstStoredEventId
and less than or equal tolastStoredEventId
, i.e., all events that occurred between the events with the given IDs, inclusive.- Specified by:
allEventsBetween
in interfaceStoredEventRepository
- Parameters:
firstStoredEventId
- ID of the firstStoredEvent
to retrievelastStoredEventId
- ID of the lastStoredEvent
to retrieve- Returns:
- a list of all
StoredEvents
with IDs betweenfirstStoredEventId
andlastStoredEventId
, inclusive
-
lastStoredEventId
Description copied from interface:StoredEventRepository
Gives the ID of the most recently savedStoredEvent
in the repository.- Specified by:
lastStoredEventId
in interfaceStoredEventRepository
- Returns:
- the ID of the most recently saved
StoredEvent
unless the repository is empty
-