Class SnapshotEventEntry

All Implemented Interfaces:
DomainEventData<byte[]>, EventData<byte[]>

@Entity @Entity public class SnapshotEventEntry extends AbstractSnapshotEventEntry<byte[]>
Default implementation of an event entry containing a serialized snapshot of an aggregate. This implementation is used by the JpaEventStorageEngine to store snapshot events. Event payload and metadata are serialized to a byte array.
Author:
Rene de Waele
  • Constructor Details

    • SnapshotEventEntry

      public SnapshotEventEntry(DomainEventMessage<?> eventMessage, Serializer serializer)
      Construct a new default snapshot event entry from an aggregate. The snapshot payload and metadata will be serialized to a byte array.

      The given serializer will be used to serialize the payload and metadata in the given eventMessage. The type of the serialized data will be the same as the given contentType.

      Parameters:
      eventMessage - The snapshot event message to convert to a serialized event entry
      serializer - The serializer to convert the snapshot event
    • SnapshotEventEntry

      protected SnapshotEventEntry()
      Default constructor required by JPA