Package de.hybris.platform.product.impl
Class DefaultProductService
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.service.AbstractService
-
- de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
-
- de.hybris.platform.product.impl.DefaultProductService
-
- All Implemented Interfaces:
ProductService,java.io.Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
public class DefaultProductService extends AbstractBusinessService implements ProductService
Default implementation of theProductService.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManager
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant
-
-
Constructor Summary
Constructors Constructor Description DefaultProductService()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancontainsProductsForCategory(CategoryModel category)Checks whether or not the specificCategoryModelor any of its sub-categories contains at least one product.java.lang.IntegergetAllProductsCountForCategory(CategoryModel category)Counts all products of the specificCategoryModelexcluding double linked products.java.util.List<ProductModel>getAllProductsForCatalogVersion(CatalogVersionModel catalogVersion)Returns allProductModellist belonging to the specifiedCatalogVersionModeljava.util.List<ProductModel>getOfflineProductsForCategory(CategoryModel category)Returns all offline products that belong to the specified category.java.util.List<ProductModel>getOnlineProductsForCategory(CategoryModel category)Returns all online products that belong to the specified category.UnitModelgetOrderableUnit(ProductModel product)Deprecated.since agesProductModelgetProduct(CatalogVersionModel catalogVersion, java.lang.String code)Deprecated.since agesProductModelgetProduct(java.lang.String code)Deprecated.since agesprotected ProductDaogetProductDao()ProductModelgetProductForCode(CatalogVersionModel catalogVersion, java.lang.String code)Returns the Product with the specified code belonging to the specified CatalogVersion.ProductModelgetProductForCode(java.lang.String code)Returns the Product with the specified code.java.util.List<ProductModel>getProducts(CategoryModel category)Deprecated.since agesSearchResult<ProductModel>getProducts(CategoryModel category, int start, int count)Deprecated.since agesjava.lang.IntegergetProductsCountForCategory(CategoryModel category)Counts all products of the specificCategoryModel.java.util.List<ProductModel>getProductsForCategory(CategoryModel category)Returns all Products belonging to the specified Category as a List.java.util.List<ProductModel>getProductsForCategory(CategoryModel category, int start, int count)Returns the specified range of Products belonging to the specified Category as a List.UnitModelgetUnit(java.lang.String code)Deprecated.since agesvoidsetPriceService(PriceService priceService)Deprecated.since agesvoidsetProductDao(ProductDao productDao)voidsetUnitDao(UnitDao unitDao)Deprecated.since ages-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManager
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
-
-
-
Method Detail
-
getProductForCode
public ProductModel getProductForCode(java.lang.String code)
Description copied from interface:ProductServiceReturns the Product with the specified code. As default the search uses the current session user, the current session language and the current active catalog versions (which are stored at the session in the attributeSESSION_CATALOG_VERSIONS). For modifying the search session context seeFlexibleSearchQuery.- Specified by:
getProductForCodein interfaceProductService- Parameters:
code- the code of the Product- Returns:
- the Product with the specified code.
-
getProduct
@Deprecated public ProductModel getProduct(java.lang.String code)
Deprecated.since ages- Specified by:
getProductin interfaceProductService- Parameters:
code- the code of the Product- Returns:
- the Product with the specified code.
-
getOrderableUnit
@Deprecated public UnitModel getOrderableUnit(ProductModel product)
Deprecated.since agesDescription copied from interface:ProductServiceReturns for the givenproductthe first foundUnitModelfrom the PriceInformations of the product.- Specified by:
getOrderableUnitin interfaceProductService- Parameters:
product- theProductModel- Returns:
ProductModel.UNITif no PriceInformations is available at theProductModel
-
getAllProductsCountForCategory
public java.lang.Integer getAllProductsCountForCategory(CategoryModel category)
Description copied from interface:ProductServiceCounts all products of the specificCategoryModelexcluding double linked products. This includes all its own products and products belonging to any sub category.- Specified by:
getAllProductsCountForCategoryin interfaceProductService- Parameters:
category- theCategoryModel- Returns:
- amount of all products of the category
-
getProductsCountForCategory
public java.lang.Integer getProductsCountForCategory(CategoryModel category)
Description copied from interface:ProductServiceCounts all products of the specificCategoryModel.- Specified by:
getProductsCountForCategoryin interfaceProductService- Parameters:
category- theCategoryModel- Returns:
- amount of all products of the category
-
containsProductsForCategory
public boolean containsProductsForCategory(CategoryModel category)
Description copied from interface:ProductServiceChecks whether or not the specificCategoryModelor any of its sub-categories contains at least one product.- Specified by:
containsProductsForCategoryin interfaceProductService- Parameters:
category- theCategoryModel- Returns:
- true if at least one product belong the the
CategoryModelor any of its sub-categories, false otherwise.
-
getUnit
@Deprecated public UnitModel getUnit(java.lang.String code)
Deprecated.since ages- Specified by:
getUnitin interfaceProductService- Parameters:
code- the code of the Unit- Returns:
- the Unit with the specified code
-
getProduct
@Deprecated public ProductModel getProduct(CatalogVersionModel catalogVersion, java.lang.String code)
Deprecated.since ages- Specified by:
getProductin interfaceProductService- Parameters:
catalogVersion- the CatalogVersion of the Productcode- the code of the Product- Returns:
- the Product matching the specified code and CatalogVersion.
-
getProductForCode
public ProductModel getProductForCode(CatalogVersionModel catalogVersion, java.lang.String code)
Description copied from interface:ProductServiceReturns the Product with the specified code belonging to the specified CatalogVersion.- Specified by:
getProductForCodein interfaceProductService- Parameters:
catalogVersion- the CatalogVersion of the Productcode- the code of the Product- Returns:
- the Product matching the specified code and CatalogVersion.
-
getProducts
@Deprecated public java.util.List<ProductModel> getProducts(CategoryModel category)
Deprecated.since ages- Specified by:
getProductsin interfaceProductService- Parameters:
category- the category the returned Products belong to- Returns:
- a list of Products which belong to the specified Category
-
getProductsForCategory
public java.util.List<ProductModel> getProductsForCategory(CategoryModel category)
Description copied from interface:ProductServiceReturns all Products belonging to the specified Category as a List. For the search the current session active catalog versions of the current user are used.- Specified by:
getProductsForCategoryin interfaceProductService- Parameters:
category- the category the returned Products belong to- Returns:
- a list of Products which belong to the specified Category
-
getProducts
@Deprecated public SearchResult<ProductModel> getProducts(CategoryModel category, int start, int count)
Deprecated.since ages- Specified by:
getProductsin interfaceProductService- Parameters:
category- the category the returned Products belong tostart- index position of the first Product, which will be included in the returned Listcount- number of Products which will be returned in the List- Returns:
- a list of Products with belong to the specified Category
-
getProductsForCategory
public java.util.List<ProductModel> getProductsForCategory(CategoryModel category, int start, int count)
Description copied from interface:ProductServiceReturns the specified range of Products belonging to the specified Category as a List. For the search the current session active catalogversions of the current user are used.- Specified by:
getProductsForCategoryin interfaceProductService- Parameters:
category- the category the returned Products belong tostart- index position of the first Product, which will be included in the returned Listcount- number of Products which will be returned in the List- Returns:
- a list of Products with belong to the specified Category
-
getOnlineProductsForCategory
public java.util.List<ProductModel> getOnlineProductsForCategory(CategoryModel category)
Description copied from interface:ProductServiceReturns all online products that belong to the specified category.- Specified by:
getOnlineProductsForCategoryin interfaceProductService- Parameters:
category- the category the returned products belong to- Returns:
- all found products that belong to the specified category, or empty collection if no product can be found.
-
getOfflineProductsForCategory
public java.util.List<ProductModel> getOfflineProductsForCategory(CategoryModel category)
Description copied from interface:ProductServiceReturns all offline products that belong to the specified category.- Specified by:
getOfflineProductsForCategoryin interfaceProductService- Parameters:
category- the category the returned products belong to- Returns:
- all found products that belong to the specified category, or empty collection if no product can be found.
-
getAllProductsForCatalogVersion
public java.util.List<ProductModel> getAllProductsForCatalogVersion(CatalogVersionModel catalogVersion)
Description copied from interface:ProductServiceReturns allProductModellist belonging to the specifiedCatalogVersionModel- Specified by:
getAllProductsForCatalogVersionin interfaceProductService- Parameters:
catalogVersion- the CatalogVersion of the Products- Returns:
- Product list belonging to the CatalogVersion
-
setProductDao
public void setProductDao(ProductDao productDao)
-
getProductDao
protected ProductDao getProductDao()
- Returns:
- the productDao
-
setUnitDao
@Deprecated public void setUnitDao(UnitDao unitDao)
Deprecated.since ages
-
setPriceService
@Deprecated public void setPriceService(PriceService priceService)
Deprecated.since ages
-
-