Interface StoredEventRepository
- All Superinterfaces:
Repository<StoredEvent,
Long>
- All Known Subinterfaces:
JpaStoredEventRepository
A repository for working with
StoredEvent
objects.- 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 storedEventId) 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.<S extends StoredEvent>
Ssave
(S storedEvent) Saves aStoredEvent
.Methods inherited from interface com.reallifedeveloper.common.domain.Repository
findById
-
Method Details
-
allEventsSince
Gives allStoredEvents
with IDs greater thanstoredEventId
, i.e., all events that occurred after the event with the given ID.- Parameters:
storedEventId
- find all events with IDs greater than this- Returns:
- a list of
StoredEvents
with IDs greater than or equal tofirstStoredEventId
-
allEventsBetween
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.- 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
-
save
Saves aStoredEvent
.- Type Parameters:
S
- the type of theStoredEvent
- Parameters:
storedEvent
- theStoredEvent
to save- Returns:
- the saved
StoredEvent
, which may have been changed by the save operation
-
lastStoredEventId
Gives the ID of the most recently savedStoredEvent
in the repository.- Returns:
- the ID of the most recently saved
StoredEvent
unless the repository is empty
-