java.lang.Object
com.broadleafcommerce.dataimport.provider.jpa.domain.JpaBatch
All Implemented Interfaces:
com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware, com.broadleafcommerce.data.tracking.core.Identifiable, com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware, com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable, Serializable

@Entity public class JpaBatch extends Object implements Serializable, com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable, com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware, com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware, com.broadleafcommerce.data.tracking.core.Identifiable
Persistent counterpart to Batch for use with a JPA-supported datastore.
Author:
Samarth Dhruva (samarthd)
See Also:
  • Constructor Details

    • JpaBatch

      public JpaBatch()
    • JpaBatch

      public JpaBatch(String id, String importId, String status, Instant created, Instant completed, String _items, List<? super com.broadleafcommerce.data.tracking.jpa.filtering.domain.JpaNotificationState> notificationStates)
  • Method Details

    • getStatus

      @Nullable public BatchStatus getStatus()
    • setStatus

      public JpaBatch setStatus(@Nullable BatchStatus status)
    • setItems

      public JpaBatch setItems(@Nullable List<JpaBatchItem> items)
      Provides a way for callers to set the _items without dealing with the serialization aspect.
      Parameters:
      items - the items to serialize and set as _items
      See Also:
    • getItems

      @Nullable public List<JpaBatchItem> getItems()
      Provides a way for callers to get the _items without dealing with the deserialization aspect.
      Returns:
      a deserialized representation of _items
      See Also:
    • setNotificationStates

      public void setNotificationStates(List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState> notificationStates)
      Specified by:
      setNotificationStates in interface com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
    • getNotificationStates

      public List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState> getNotificationStates()
      Specified by:
      getNotificationStates in interface com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
    • getNotificationStates

      public List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState> getNotificationStates(boolean fetch)
      Specified by:
      getNotificationStates in interface com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
    • getBusinessDomainType

      public Class<?> getBusinessDomainType()
      Specified by:
      getBusinessDomainType in interface com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
    • fromMe

      public org.modelmapper.ModelMapper fromMe()
      Specified by:
      fromMe in interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
    • toMe

      public org.modelmapper.ModelMapper toMe()
      Specified by:
      toMe in interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
    • getId

      public String getId()
      Specified by:
      getId in interface com.broadleafcommerce.data.tracking.core.Identifiable
    • getImportId

      public String getImportId()
      The import that this batch request is associated with
    • getCreated

      public Instant getCreated()
    • getCompleted

      public Instant getCompleted()
    • get_items

      public String get_items()
      The items that should be inserted within this batch.

      Stores a List of JpaBatchItem serialized as a JSON in the data store.

      Generally speaking, callers should use getItems() and setItems(List) and not directly deal with this field. In rare circumstances (such as update queries like JpaCustomizedImportBatchRepository.replaceContainedItems(JpaBatch)), it may make sense to directly modify this value.

      Rather than simply annotating the column with the @Convert annotation, we have different methods that manually invoke the BatchItemListConverter. This is because the automatic-conversion does not work properly when using CriteriaUpdate. Hibernate would forcefully attempt to split the list into multiple query parameters and convert the elements individually (in QueryParameterBindingsImpl.expandListValuedParameters(java.lang.String, org.hibernate.engine.spi.SharedSessionContractImplementor)), which caused errors to be thrown.

      See Also:
    • setId

      public void setId(String id)
    • setImportId

      public void setImportId(String importId)
      The import that this batch request is associated with
    • setCreated

      public void setCreated(Instant created)
    • setCompleted

      public void setCompleted(Instant completed)
    • set_items

      public void set_items(String _items)
      The items that should be inserted within this batch.

      Stores a List of JpaBatchItem serialized as a JSON in the data store.

      Generally speaking, callers should use getItems() and setItems(List) and not directly deal with this field. In rare circumstances (such as update queries like JpaCustomizedImportBatchRepository.replaceContainedItems(JpaBatch)), it may make sense to directly modify this value.

      Rather than simply annotating the column with the @Convert annotation, we have different methods that manually invoke the BatchItemListConverter. This is because the automatic-conversion does not work properly when using CriteriaUpdate. Hibernate would forcefully attempt to split the list into multiple query parameters and convert the elements individually (in QueryParameterBindingsImpl.expandListValuedParameters(java.lang.String, org.hibernate.engine.spi.SharedSessionContractImplementor)), which caused errors to be thrown.

      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object