Interface StoredEventRepository

All Superinterfaces:
Repository<StoredEvent,Long>
All Known Subinterfaces:
JpaStoredEventRepository

public interface StoredEventRepository extends Repository<StoredEvent,Long>
A repository for working with StoredEvent objects.
Author:
RealLifeDeveloper
  • Method Summary

    Modifier and Type
    Method
    Description
    allEventsBetween(long firstStoredEventId, long lastStoredEventId)
    Gives all StoredEvents with IDs greater than or equal to firstStoredEventId and less than or equal to lastStoredEventId, i.e., all events that occurred between the events with the given IDs, inclusive.
    allEventsSince(long storedEventId)
    Gives all StoredEvents with IDs greater than storedEventId, i.e., all events that occurred after the event with the given ID.
    Gives the ID of the most recently saved StoredEvent in the repository.
    <S extends StoredEvent>
    S
    save(S storedEvent)
    Saves a StoredEvent.

    Methods inherited from interface com.reallifedeveloper.common.domain.Repository

    findById
  • Method Details

    • allEventsSince

      List<StoredEvent> allEventsSince(long storedEventId)
      Gives all StoredEvents with IDs greater than storedEventId, 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 to firstStoredEventId
    • allEventsBetween

      List<StoredEvent> allEventsBetween(long firstStoredEventId, long lastStoredEventId)
      Gives all StoredEvents with IDs greater than or equal to firstStoredEventId and less than or equal to lastStoredEventId, i.e., all events that occurred between the events with the given IDs, inclusive.
      Parameters:
      firstStoredEventId - ID of the first StoredEvent to retrieve
      lastStoredEventId - ID of the last StoredEvent to retrieve
      Returns:
      a list of all StoredEvents with IDs between firstStoredEventId and lastStoredEventId, inclusive
    • save

      <S extends StoredEvent> S save(S storedEvent)
      Saves a StoredEvent.
      Type Parameters:
      S - the type of the StoredEvent
      Parameters:
      storedEvent - the StoredEvent to save
      Returns:
      the saved StoredEvent, which may have been changed by the save operation
    • lastStoredEventId

      Optional<Long> lastStoredEventId()
      Gives the ID of the most recently saved StoredEvent in the repository.
      Returns:
      the ID of the most recently saved StoredEvent unless the repository is empty