Class ModelAwareTransactionCallback<M extends ItemModel>

  • All Implemented Interfaces:
    org.springframework.transaction.support.TransactionCallback
    Direct Known Subclasses:
    ModelAwareTransactionCallbackWithoutResult

    public abstract class ModelAwareTransactionCallback<M extends ItemModel>
    extends java.lang.Object
    implements org.springframework.transaction.support.TransactionCallback
    Model-aware transaction wrapper which internally consist of preparation , performing the logic from doInModelAwareTransaction(TransactionStatus) and storing phase.

    Preparation consist of:

    • creating/getting transaction for current thread;
    • setting provided enableDelayed store flag;
    • *

    Store phase consist of:

    • saving all unsaved models via provided model service;
    • Constructor Detail

      • ModelAwareTransactionCallback

        public ModelAwareTransactionCallback()
    • Method Detail

      • getModelService

        protected abstract ModelService getModelService()
        Returns:
        the modelService
      • isEnableDelayedStore

        protected boolean isEnableDelayedStore()
        Returns:
        enableDelayedStore flag, by default delayed store is disabled.
      • doInTransaction

        public final M doInTransaction​(org.springframework.transaction.TransactionStatus status)
        Specified by:
        doInTransaction in interface org.springframework.transaction.support.TransactionCallback<M extends ItemModel>
      • doInModelAwareTransaction

        protected abstract M doInModelAwareTransaction​(org.springframework.transaction.TransactionStatus status)
        Method used for providing model-aware execution inside transaction.