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 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 storedEventId) 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.<S extends StoredEvent>
Ssave(S storedEvent) Saves aStoredEvent.Methods inherited from interface com.reallifedeveloper.common.domain.Repository
findById
-
Method Details
-
allEventsSince
Gives allStoredEventswith 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
StoredEventswith IDs greater than or equal tofirstStoredEventId
-
allEventsBetween
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.- Parameters:
firstStoredEventId- ID of the firstStoredEventto retrievelastStoredEventId- ID of the lastStoredEventto retrieve- Returns:
- a list of all
StoredEventswith IDs betweenfirstStoredEventIdandlastStoredEventId, inclusive
-
save
Saves aStoredEvent.- Type Parameters:
S- the type of theStoredEvent- Parameters:
storedEvent- theStoredEventto save- Returns:
- the saved
StoredEvent, which may have been changed by the save operation
-
lastStoredEventId
Gives the ID of the most recently savedStoredEventin the repository.- Returns:
- the ID of the most recently saved
StoredEventunless the repository is empty
-