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
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
org.modelmapper.ModelMapper
fromMe()
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_items
without dealing with the deserialization aspect.List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState>
List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState>
getNotificationStates
(boolean fetch) int
hashCode()
void
The items that should be inserted within this batch.void
setCompleted
(Instant completed) void
setCreated
(Instant created) void
void
setImportId
(String importId) The import that this batch request is associated withsetItems
(List<JpaBatchItem> items) Provides a way for callers to set the_items
without dealing with the serialization aspect.void
setNotificationStates
(List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState> notificationStates) setStatus
(BatchStatus status) org.modelmapper.ModelMapper
toMe()
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
postFromMe, postToMe, preFromMe, preToMe
Methods 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_items
without 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_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 interfacecom.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
-
getNotificationStates
public List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState> getNotificationStates()- Specified by:
getNotificationStates
in interfacecom.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
-
getNotificationStates
public List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState> getNotificationStates(boolean fetch) - Specified by:
getNotificationStates
in interfacecom.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
-
getBusinessDomainType
- Specified by:
getBusinessDomainType
in interfacecom.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
-
fromMe
public org.modelmapper.ModelMapper fromMe()- Specified by:
fromMe
in interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
toMe
public org.modelmapper.ModelMapper toMe()- Specified by:
toMe
in interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
getId
- Specified by:
getId
in 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
List
ofJpaBatchItem
serialized 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
@Convert
annotation, 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.items
getItems()
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
List
ofJpaBatchItem
serialized 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
@Convert
annotation, 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.items
getItems()
setItems(List)
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-