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 allStoredEventswith IDs greater than or equal tofirstStoredEventIdand less than or equal tolastStoredEventId, i.e., all events that occurred between the events with the given IDs, inclusive.allEventsSince(long firstStoredEventId) Gives allStoredEventswith IDs greater thanstoredEventId, i.e., all events that occurred after the event with the given ID.Gives the ID of the most recently savedStoredEventin the repository.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOneMethods inherited from interface com.reallifedeveloper.common.domain.Repository
findByIdMethods 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:StoredEventRepositoryGives allStoredEventswith IDs greater thanstoredEventId, i.e., all events that occurred after the event with the given ID.- Specified by:
allEventsSincein interfaceStoredEventRepository- Parameters:
firstStoredEventId- find all events with IDs greater than this- Returns:
- a list of
StoredEventswith 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:StoredEventRepositoryGives allStoredEventswith IDs greater than or equal tofirstStoredEventIdand less than or equal tolastStoredEventId, i.e., all events that occurred between the events with the given IDs, inclusive.- Specified by:
allEventsBetweenin interfaceStoredEventRepository- Parameters:
firstStoredEventId- ID of the firstStoredEventto retrievelastStoredEventId- ID of the lastStoredEventto retrieve- Returns:
- a list of all
StoredEventswith IDs betweenfirstStoredEventIdandlastStoredEventId, inclusive
-
lastStoredEventId
Description copied from interface:StoredEventRepositoryGives the ID of the most recently savedStoredEventin the repository.- Specified by:
lastStoredEventIdin interfaceStoredEventRepository- Returns:
- the ID of the most recently saved
StoredEventunless the repository is empty
-