Class JpaCustomizedItemListItemRepository<D extends JpaItemListItem>
java.lang.Object
com.broadleafcommerce.cart.provider.jpa.repository.JpaCustomizedItemListItemRepository<D>
- All Implemented Interfaces:
CustomizedItemListItemRepository<D>
,org.springframework.beans.factory.InitializingBean
public class JpaCustomizedItemListItemRepository<D extends JpaItemListItem>
extends Object
implements CustomizedItemListItemRepository<D>, org.springframework.beans.factory.InitializingBean
JPA implementation of a customized item list item repository.
- Author:
- Jacob Mitash
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJpaCustomizedItemListItemRepository
(com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder criteriaBuilder, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager typeManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
deleteAllByListIds
(Collection<String> listIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Bulk deletes all items that belong to multiple listsprotected JpaCustomizedRepositoryHelper<D>
protected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelper
protected ItemListItemRepository<D>
readAllCountsByItemListId
(@NonNull Iterable<String> itemListIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds the item count per item list.org.springframework.data.domain.Page<D>
readByItemListId
(String itemListId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, org.springframework.data.domain.Pageable page) Find items belonging to a specific list.void
setRepository
(ItemListItemRepository<D> repository)
-
Field Details
-
ITEM_LIST_ID
- See Also:
-
-
Constructor Details
-
JpaCustomizedItemListItemRepository
public JpaCustomizedItemListItemRepository(com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder criteriaBuilder, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager typeManager)
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
readByItemListId
public org.springframework.data.domain.Page<D> readByItemListId(String itemListId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @Nullable org.springframework.data.domain.Pageable page) Description copied from interface:CustomizedItemListItemRepository
Find items belonging to a specific list.- Specified by:
readByItemListId
in interfaceCustomizedItemListItemRepository<D extends JpaItemListItem>
- Parameters:
itemListId
- the ID of the owning item listcontextInfo
- the request context informationpage
- the requested page of results from the database- Returns:
- a page of item lists items owned by the item list
-
deleteAllByListIds
@Transactional("cartTransactionManager") public void deleteAllByListIds(Collection<String> listIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:CustomizedItemListItemRepository
Bulk deletes all items that belong to multiple lists- Specified by:
deleteAllByListIds
in interfaceCustomizedItemListItemRepository<D extends JpaItemListItem>
- Parameters:
listIds
- list of item list ids to delete fromcontext
- the request context information
-
readAllCountsByItemListId
public Map<String,Long> readAllCountsByItemListId(@NonNull @NonNull Iterable<String> itemListIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CustomizedItemListItemRepository
Finds the item count per item list.- Specified by:
readAllCountsByItemListId
in interfaceCustomizedItemListItemRepository<D extends JpaItemListItem>
- Parameters:
itemListIds
- the IDs of the owning item listscontextInfo
- the request context information- Returns:
- a map of item list IDs and its associated item count
-
getNarrowingHelper
protected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelper getNarrowingHelper() -
getRepository
-
setRepository
-
getHelper
-