Class TransactionServiceImpl

java.lang.Object
org.openwms.transactions.impl.TransactionServiceImpl
All Implemented Interfaces:
Persistable<Transaction>, TransactionService

@Validated @TxService class TransactionServiceImpl extends Object implements TransactionService
A TransactionServiceImpl.
Author:
Heiko Scherrer
  • Field Details

    • eventPublisher

      private final org.springframework.context.ApplicationEventPublisher eventPublisher
    • tracer

      private final io.micrometer.tracing.Tracer tracer
    • translator

      private final org.ameba.i18n.Translator translator
    • transactionRepository

      private final TransactionRepository transactionRepository
  • Constructor Details

    • TransactionServiceImpl

      TransactionServiceImpl(org.springframework.context.ApplicationEventPublisher eventPublisher, io.micrometer.tracing.Tracer tracer, org.ameba.i18n.Translator translator, TransactionRepository transactionRepository)
  • Method Details

    • findAll

      @Measured @NotNull public @NotNull List<Transaction> findAll()
      Find and return all Transaction instances.
      Specified by:
      findAll in interface TransactionService
      Returns:
      All instances, never null
    • findByType

      @Measured @NotNull public @NotNull List<Transaction> findByType(@NotBlank @NotBlank String type)
      Find and return all Transaction entries of the given type.
      Specified by:
      findByType in interface TransactionService
      Parameters:
      type - The type to search for
      Returns:
      All existing entries, never null
    • findByPKeyOrThrow

      @Measured @NotNull public @NotNull Transaction findByPKeyOrThrow(@NotBlank @NotBlank String pKey)
      Find and return a Transaction.
      Specified by:
      findByPKeyOrThrow in interface TransactionService
      Parameters:
      pKey - The persistent key of the Transaction
      Returns:
      The instance
    • findInternal

      private Transaction findInternal(String pKey)
    • persist

      @Measured @Validated(Create.class) @NotNull public @NotNull Transaction persist(@NotNull @Valid @NotNull @Valid Transaction transaction)
      Persists the given instance.
      Specified by:
      persist in interface Persistable<Transaction>
      Parameters:
      transaction - The instance to persist
      Returns:
      The persisted instance
    • createInternal

      private Transaction createInternal(Transaction transaction)
    • persist

      @Measured @Validated(Create.class) public void persist(@NotNull @Valid @NotNull @Valid List<Transaction> transactions)
      Persists a list of given instances.
      Specified by:
      persist in interface Persistable<Transaction>
      Parameters:
      transactions - The instances to persist