Class TransactionalMongoJaversBuilder

java.lang.Object
org.javers.core.AbstractContainerBuilder
org.javers.core.JaversBuilder
org.javers.spring.mongodb.TransactionalMongoJaversBuilder

public final class TransactionalMongoJaversBuilder extends org.javers.core.JaversBuilder
Creates transactional Javers instance if MongoTransactionManager is provided.

Allows Javers' MongoRepository to participate in application's transactions managed by MongoTransactionManager.

Note that multi-document ACID transactions was introduced in MongoDB 4.0 and Spring Data MongoDB 2.1.

See https://www.baeldung.com/spring-data-mongodb-transactions, https://www.mongodb.com/blog/post/mongodb-multi-document-acid-transactions-general-availability
Since:
6.5
  • Field Summary

    Fields inherited from class org.javers.core.JaversBuilder

    logger
  • Method Summary

    Modifier and Type
    Method
    Description
    org.javers.core.Javers
     
     
    registerJaversRepository(org.javers.repository.api.JaversRepository mongoRepository)
     
    withTxManager(org.springframework.data.mongodb.MongoTransactionManager txManager)
     

    Methods inherited from class org.javers.core.JaversBuilder

    assembleJaversInstance, assembleJaversInstanceAndEnsureSchema, registerCustomComparator, registerCustomType, registerEntities, registerEntity, registerEntity, registerIgnoredClass, registerIgnoredClassesStrategy, registerJsonAdvancedTypeAdapter, registerObjectHasher, registerType, registerTypes, registerValue, registerValue, registerValue, registerValue, registerValueGsonTypeAdapter, registerValueObject, registerValueObject, registerValueObjects, registerValueTypeAdapter, registerValueWithCustomToString, scanTypeName, withCommitIdGenerator, withCustomCommitIdGenerator, withDateTimeProvider, withInitialChanges, withListCompareAlgorithm, withMappingStyle, withNewObjectsSnapshot, withObjectAccessHook, withPackagesToScan, withPrettyPrint, withPrettyPrintDateFormats, withProperties, withTerminalChanges, withTypeSafeValues, withUsePrimitiveDefaults

    Methods inherited from class org.javers.core.AbstractContainerBuilder

    addComponent, addModule, addModule, bindComponent, bootContainer, getComponents, getContainer, getContainerComponent, removeComponent

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • javers

      public static TransactionalMongoJaversBuilder javers()
    • withTxManager

      public TransactionalMongoJaversBuilder withTxManager(org.springframework.data.mongodb.MongoTransactionManager txManager)
      Parameters:
      txManager - nullable
    • registerJaversRepository

      public TransactionalMongoJaversBuilder registerJaversRepository(org.javers.repository.api.JaversRepository mongoRepository)
      Overrides:
      registerJaversRepository in class org.javers.core.JaversBuilder
    • build

      public org.javers.core.Javers build()
      Overrides:
      build in class org.javers.core.JaversBuilder