java.lang.Object
org.axonframework.modelling.saga.repository.jpa.SagaEntry<T>
Type Parameters:
T - the type of saga stored in this entry

@Entity public class SagaEntry<T> extends Object
Java Persistence Entity allowing sagas to be stored in a relational database.
Since:
0.7
Author:
Allard Buijze
  • Field Details

    • LEGACY_REVISION

      public static final String LEGACY_REVISION
      Value written to the revision column of a saga inserted by this module, marking the row as one created here rather than by Axon Framework 4:
      
       SELECT sagaId FROM SagaEntry WHERE revision = 'axon-legacy'
       
      Written on insert only. An update leaves the column alone, so a value written by Axon Framework 4 survives.
      See Also:
    • sagaId

      protected String sagaId
    • sagaType

      protected String sagaType
    • revision

      protected String revision
      Set to LEGACY_REVISION for an entry constructed here, and otherwise whatever wrote the row put there. Never read back when loading a saga.
    • serializedSaga

      protected byte[] serializedSaga
  • Constructor Details

    • SagaEntry

      public SagaEntry(T saga, String sagaIdentifier, Converter converter)
      Constructs a new SagaEntry for the given saga. The given saga must be convertible to a byte array. The provided saga is not modified by this operation.
      Parameters:
      saga - The saga to store
      sagaIdentifier - The saga identifier
      converter - The conversion mechanism to convert the Saga to a byte stream
    • SagaEntry

      protected SagaEntry()
      Constructor required by JPA. Do not use.
      See Also:
  • Method Details

    • getSerializedSaga

      public byte[] getSerializedSaga()
      Returns the serialized form of the Saga.
      Returns:
      the serialized form of the Saga
    • getSagaId

      public String getSagaId()
      Returns the identifier of the saga contained in this entry
      Returns:
      the identifier of the saga contained in this entry
    • getRevision

      public String getRevision()
      Returns the revision of the serialized saga, which is LEGACY_REVISION for an entry constructed here.
      Returns:
      the revision of the serialized saga
    • getSagaType

      public String getSagaType()
      Returns the type identifier of the serialized saga
      Returns:
      the type identifier of the serialized saga