Class JpaSagaStore.Builder
java.lang.Object
org.axonframework.modelling.saga.repository.jpa.JpaSagaStore.Builder
- Enclosing class:
JpaSagaStore
Builder class to instantiate a
JpaSagaStore.
The EntityManagerProvider and Serializer are hard requirements and as such should be
provided.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aJpaSagaStoreas specified through this Builder.entityManagerProvider(EntityManagerProvider entityManagerProvider) Sets theEntityManagerProviderwhich provides theEntityManagerused to access the underlying database.serializer(Serializer serializer) Sets theSerializerused to de-/serialize a Saga instance.protected voidvalidate()Validates whether the fields contained in this Builder are set accordingly.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
entityManagerProvider
Sets theEntityManagerProviderwhich provides theEntityManagerused to access the underlying database.- Parameters:
entityManagerProvider- aEntityManagerProviderwhich provides theEntityManagerused to access the underlying database- Returns:
- the current Builder instance, for fluent interfacing
-
serializer
Sets theSerializerused to de-/serialize a Saga instance.- Parameters:
serializer- aSerializerused to de-/serialize a Saga instance- Returns:
- the current Builder instance, for fluent interfacing
-
build
Initializes aJpaSagaStoreas specified through this Builder.- Returns:
- a
JpaSagaStoreas specified through this Builder
-
validate
Validates whether the fields contained in this Builder are set accordingly.- Throws:
AxonConfigurationException- if one field is asserted to be incorrect according to the Builder's specifications
-