Class DefaultCommerceCartDao
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
-
- de.hybris.platform.commerceservices.order.dao.impl.DefaultCommerceCartDao
-
- All Implemented Interfaces:
CommerceCartDao,Dao
- Direct Known Subclasses:
DefaultSaveCartDao,DefaultSubscriptionCommerceCartDao
public class DefaultCommerceCartDao extends AbstractItemDao implements CommerceCartDao
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringFIND_CART_FOR_CODE_AND_SITEprotected static java.lang.StringFIND_CART_FOR_GUID_AND_SITEprotected static java.lang.StringFIND_CART_FOR_GUID_AND_USER_AND_SITEprotected static java.lang.StringFIND_CART_FOR_SITE_AND_USER_AND_EXCLUDED_GUIDprotected static java.lang.StringFIND_CART_FOR_USER_AND_SITEprotected static java.lang.StringFIND_CARTS_FOR_SITE_AND_USERprotected static java.lang.StringFIND_EXPIRED_SAVED_CARTS_FOR_SITE_AND_USERprotected static java.lang.StringFIND_OLD_CARTS_FOR_SITEprotected static java.lang.StringFIND_OLD_CARTS_FOR_SITE_AND_USERprotected static java.lang.StringNOT_QUOTE_CART_CLAUSEprotected static java.lang.StringNOT_SAVED_CART_CLAUSEprotected static java.lang.StringORDERBYCLAUSEprotected static java.lang.StringSELECTCLAUSE-
Fields inherited from class de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
flexibleSearchService, modelService
-
-
Constructor Summary
Constructors Constructor Description DefaultCommerceCartDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> FlexibleSearchQuerycreateSearchQuery(java.lang.String query, java.util.Map<java.lang.String,java.lang.Object> params, java.lang.Class<T> resultClass)protected <T> java.util.List<T>doSearch(java.lang.String query, java.util.Map<java.lang.String,java.lang.Object> params, java.lang.Class<T> resultClass)Search for all.protected <T> java.util.List<T>doSearch(java.lang.String query, java.util.Map<java.lang.String,java.lang.Object> params, java.lang.Class<T> resultClass, int count)Do search with count.CartModelgetCartForCodeAndUser(java.lang.String code, UserModel user)Gets the cart for code and user.CartModelgetCartForGuidAndSite(java.lang.String guid, BaseSiteModel site)Gets the cart for guid and site.CartModelgetCartForGuidAndSiteAndUser(java.lang.String guid, BaseSiteModel site, UserModel user)Gets the cart for guid and site and user.CartModelgetCartForSiteAndUser(BaseSiteModel site, UserModel user)Gets the cart for site and user.java.util.List<CartModel>getCartsForRemovalForSiteAndUser(java.util.Date modifiedBefore, BaseSiteModel site, UserModel user)Gets the carts for removal for site and user.java.util.List<CartModel>getCartsForSiteAndUser(BaseSiteModel site, UserModel user)Gets the carts for site and user.-
Methods inherited from class de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
getAllSources, getFlexibleSearchService, getModelService, getSource, load, loadAll, search, search, searchUnique, setFlexibleSearchService, setModelService
-
-
-
-
Field Detail
-
SELECTCLAUSE
protected static final java.lang.String SELECTCLAUSE
- See Also:
- Constant Field Values
-
ORDERBYCLAUSE
protected static final java.lang.String ORDERBYCLAUSE
- See Also:
- Constant Field Values
-
NOT_SAVED_CART_CLAUSE
protected static final java.lang.String NOT_SAVED_CART_CLAUSE
- See Also:
- Constant Field Values
-
NOT_QUOTE_CART_CLAUSE
protected static final java.lang.String NOT_QUOTE_CART_CLAUSE
- See Also:
- Constant Field Values
-
FIND_CART_FOR_CODE_AND_SITE
protected static final java.lang.String FIND_CART_FOR_CODE_AND_SITE
- See Also:
- Constant Field Values
-
FIND_CART_FOR_USER_AND_SITE
protected static final java.lang.String FIND_CART_FOR_USER_AND_SITE
- See Also:
- Constant Field Values
-
FIND_CART_FOR_GUID_AND_USER_AND_SITE
protected static final java.lang.String FIND_CART_FOR_GUID_AND_USER_AND_SITE
- See Also:
- Constant Field Values
-
FIND_CART_FOR_GUID_AND_SITE
protected static final java.lang.String FIND_CART_FOR_GUID_AND_SITE
- See Also:
- Constant Field Values
-
FIND_CARTS_FOR_SITE_AND_USER
protected static final java.lang.String FIND_CARTS_FOR_SITE_AND_USER
- See Also:
- Constant Field Values
-
FIND_CART_FOR_SITE_AND_USER_AND_EXCLUDED_GUID
protected static final java.lang.String FIND_CART_FOR_SITE_AND_USER_AND_EXCLUDED_GUID
- See Also:
- Constant Field Values
-
FIND_OLD_CARTS_FOR_SITE
protected static final java.lang.String FIND_OLD_CARTS_FOR_SITE
- See Also:
- Constant Field Values
-
FIND_OLD_CARTS_FOR_SITE_AND_USER
protected static final java.lang.String FIND_OLD_CARTS_FOR_SITE_AND_USER
- See Also:
- Constant Field Values
-
FIND_EXPIRED_SAVED_CARTS_FOR_SITE_AND_USER
protected static final java.lang.String FIND_EXPIRED_SAVED_CARTS_FOR_SITE_AND_USER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCartForCodeAndUser
public CartModel getCartForCodeAndUser(java.lang.String code, UserModel user)
Description copied from interface:CommerceCartDaoGets the cart for code and user.- Specified by:
getCartForCodeAndUserin interfaceCommerceCartDao- Parameters:
code- the codeuser- the user- Returns:
- the cart for code and user
-
getCartForSiteAndUser
public CartModel getCartForSiteAndUser(BaseSiteModel site, UserModel user)
Description copied from interface:CommerceCartDaoGets the cart for site and user. Excluding saved carts and quote carts. To get save cart, useSaveCartDao.getSavedCartsForSiteAndUser(de.hybris.platform.commerceservices.search.pagedata.PageableData, BaseSiteModel, UserModel, List)- Specified by:
getCartForSiteAndUserin interfaceCommerceCartDao- Parameters:
site- the siteuser- the user- Returns:
- the cart for site and user
-
getCartForGuidAndSiteAndUser
public CartModel getCartForGuidAndSiteAndUser(java.lang.String guid, BaseSiteModel site, UserModel user)
Description copied from interface:CommerceCartDaoGets the cart for guid and site and user.- Specified by:
getCartForGuidAndSiteAndUserin interfaceCommerceCartDao- Parameters:
guid- the guidsite- the siteuser- the user- Returns:
- the cart for guid and site and user
-
getCartForGuidAndSite
public CartModel getCartForGuidAndSite(java.lang.String guid, BaseSiteModel site)
Description copied from interface:CommerceCartDaoGets the cart for guid and site.- Specified by:
getCartForGuidAndSitein interfaceCommerceCartDao- Parameters:
guid- the guidsite- the site- Returns:
- the cart for guid and site
-
getCartsForSiteAndUser
public java.util.List<CartModel> getCartsForSiteAndUser(BaseSiteModel site, UserModel user)
Description copied from interface:CommerceCartDaoGets the carts for site and user. Excluding saved carts and quote carts. To get save cart, useSaveCartDao.getSavedCartsForSiteAndUser(de.hybris.platform.commerceservices.search.pagedata.PageableData, BaseSiteModel, UserModel, List)- Specified by:
getCartsForSiteAndUserin interfaceCommerceCartDao- Parameters:
site- the siteuser- the user- Returns:
- the carts for site and user
-
getCartsForRemovalForSiteAndUser
public java.util.List<CartModel> getCartsForRemovalForSiteAndUser(java.util.Date modifiedBefore, BaseSiteModel site, UserModel user)
Description copied from interface:CommerceCartDaoGets the carts for removal for site and user. Excluding saved carts. To get save cart for removal, useSaveCartDao.getSavedCartsForRemovalForSite(BaseSiteModel)- Specified by:
getCartsForRemovalForSiteAndUserin interfaceCommerceCartDao- Parameters:
modifiedBefore- the modified beforesite- the siteuser- the user- Returns:
- the carts for removal for site and user
-
doSearch
protected <T> java.util.List<T> doSearch(java.lang.String query, java.util.Map<java.lang.String,java.lang.Object> params, java.lang.Class<T> resultClass)Search for all.- Type Parameters:
T- the generic type- Parameters:
query- the queryparams- the paramsresultClass- the result class- Returns:
- the list
-
doSearch
protected <T> java.util.List<T> doSearch(java.lang.String query, java.util.Map<java.lang.String,java.lang.Object> params, java.lang.Class<T> resultClass, int count)Do search with count. For example, if set count to 1, only the first one of the result will be returned.- Type Parameters:
T- the generic type- Parameters:
query- the queryparams- the paramsresultClass- the result classcount- the count- Returns:
- the list
-
createSearchQuery
protected <T> FlexibleSearchQuery createSearchQuery(java.lang.String query, java.util.Map<java.lang.String,java.lang.Object> params, java.lang.Class<T> resultClass)
-
-