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 Modifier and Type Field Description static StringITEM_LIST_ID
-
Constructor Summary
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()voiddeleteAllByListIds(Collection<String> listIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)Bulk deletes all items that belong to multiple listsprotected JpaCustomizedRepositoryHelper<D>getHelper()protected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelpergetNarrowingHelper()protected ItemListItemRepository<D>getRepository()Map<String,Long>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.voidsetRepository(ItemListItemRepository<D> repository)
-
-
-
Field Detail
-
ITEM_LIST_ID
public static final String ITEM_LIST_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
setRepository
@Autowired @Lazy public void setRepository(ItemListItemRepository<D> repository)
-
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:CustomizedItemListItemRepositoryFind items belonging to a specific list.- Specified by:
readByItemListIdin 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:CustomizedItemListItemRepositoryBulk deletes all items that belong to multiple lists- Specified by:
deleteAllByListIdsin 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:CustomizedItemListItemRepositoryFinds the item count per item list.- Specified by:
readAllCountsByItemListIdin 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
protected ItemListItemRepository<D> getRepository()
-
getHelper
protected JpaCustomizedRepositoryHelper<D> getHelper()
-
-