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 String
ITEM_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 void
afterPropertiesSet()
void
deleteAllByListIds(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.JpaNarrowingHelper
getNarrowingHelper()
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.void
setRepository(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:
afterPropertiesSet
in 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: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
protected ItemListItemRepository<D> getRepository()
-
getHelper
protected JpaCustomizedRepositoryHelper<D> getHelper()
-
-