Class 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
Batch for use with a JPA-supported datastore.- Author:
- Samarth Dhruva (samarthd)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanorg.modelmapper.ModelMapperfromMe()The items that should be inserted within this batch.Class<?>getId()The import that this batch request is associated withgetItems()Provides a way for callers to get the_itemswithout dealing with the deserialization aspect.List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState>List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState>getNotificationStates(boolean fetch) inthashCode()voidThe items that should be inserted within this batch.voidsetCompleted(Instant completed) voidsetCreated(Instant created) voidvoidsetImportId(String importId) The import that this batch request is associated withsetItems(List<JpaBatchItem> items) Provides a way for callers to set the_itemswithout dealing with the serialization aspect.voidsetNotificationStates(List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState> notificationStates) setStatus(BatchStatus status) org.modelmapper.ModelMappertoMe()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
postFromMe, postToMe, preFromMe, preToMeMethods inherited from interface com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
findNotificationState
-
Constructor Details
-
JpaBatch
public JpaBatch() -
JpaBatch
-
-
Method Details
-
getStatus
-
setStatus
-
setItems
Provides a way for callers to set the_itemswithout dealing with the serialization aspect.- Parameters:
items- the items to serialize and set as_items- See Also:
-
getItems
Provides a way for callers to get the_itemswithout 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:
setNotificationStatesin interfacecom.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
-
getNotificationStates
public List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState> getNotificationStates()- Specified by:
getNotificationStatesin interfacecom.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
-
getNotificationStates
public List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState> getNotificationStates(boolean fetch) - Specified by:
getNotificationStatesin interfacecom.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
-
getBusinessDomainType
- Specified by:
getBusinessDomainTypein interfacecom.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
-
fromMe
public org.modelmapper.ModelMapper fromMe()- Specified by:
fromMein interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
toMe
public org.modelmapper.ModelMapper toMe()- Specified by:
toMein interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
getId
- Specified by:
getIdin interfacecom.broadleafcommerce.data.tracking.core.Identifiable
-
getImportId
The import that this batch request is associated with -
getCreated
-
getCompleted
-
get_items
The items that should be inserted within this batch.Stores a
ListofJpaBatchItemserialized as a JSON in the data store.Generally speaking, callers should use
getItems()andsetItems(List)and not directly deal with this field. In rare circumstances (such as update queries likeJpaCustomizedImportBatchRepository.replaceContainedItems(JpaBatch)), it may make sense to directly modify this value.Rather than simply annotating the column with the
@Convertannotation, we have different methods that manually invoke theBatchItemListConverter. This is because the automatic-conversion does not work properly when usingCriteriaUpdate. Hibernate would forcefully attempt to split the list into multiple query parameters and convert the elements individually (inQueryParameterBindingsImpl#expandListValuedParameters(java.lang.String, org.hibernate.engine.spi.SharedSessionContractImplementor)), which caused errors to be thrown.- See Also:
-
Batch.itemsgetItems()setItems(List)
-
setId
-
setImportId
The import that this batch request is associated with -
setCreated
-
setCompleted
-
set_items
The items that should be inserted within this batch.Stores a
ListofJpaBatchItemserialized as a JSON in the data store.Generally speaking, callers should use
getItems()andsetItems(List)and not directly deal with this field. In rare circumstances (such as update queries likeJpaCustomizedImportBatchRepository.replaceContainedItems(JpaBatch)), it may make sense to directly modify this value.Rather than simply annotating the column with the
@Convertannotation, we have different methods that manually invoke theBatchItemListConverter. This is because the automatic-conversion does not work properly when usingCriteriaUpdate. Hibernate would forcefully attempt to split the list into multiple query parameters and convert the elements individually (inQueryParameterBindingsImpl#expandListValuedParameters(java.lang.String, org.hibernate.engine.spi.SharedSessionContractImplementor)), which caused errors to be thrown.- See Also:
-
Batch.itemsgetItems()setItems(List)
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-