Class PersistenceRequest<T>

java.lang.Object
com.broadleafcommerce.common.dataimport.util.PersistenceRequest<T>

public final class PersistenceRequest<T> extends Object
Intended for use by ImportBatchHandler implementations to capture all relevant information about a parsed/converted record such that it can be submitted for persistence and completion information can be produced for it.
Author:
Phillip Verheyden (phillipuniverse)
  • Constructor Details

    • PersistenceRequest

      public PersistenceRequest(T toSave, com.broadleafcommerce.data.tracking.core.type.OperationType operation, String correlationId)
    • PersistenceRequest

      public PersistenceRequest(T toSave, com.broadleafcommerce.data.tracking.core.type.OperationType operation, String correlationId, List<PersistenceRequest.EmbeddedItemRequest> embeddedItemRequests)
  • Method Details

    • getToSave

      public T getToSave()
      The actual entity to persist.
    • getOperation

      public com.broadleafcommerce.data.tracking.core.type.OperationType getOperation()
      The type of operation to perform for this object.

      Since we typically assign the id regardless of whether it was a create or update, this allows us to differentiate the cases reliably.

    • getCorrelationId

      public String getCorrelationId()
      The correlation ID from the original record, will ultimately be set on the BatchCompletionRecord.correlationId.
    • getEmbeddedItemRequests

      public List<PersistenceRequest.EmbeddedItemRequest> getEmbeddedItemRequests()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object