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 boolean
containsProductsForCategory(CategoryModel category)
Checks whether or not the specificCategoryModel
or any of its sub-categories contains at least one product.java.lang.Integer
getAllProductsCountForCategory(CategoryModel category)
Counts all products of the specificCategoryModel
excluding double linked products.java.util.List<ProductModel>
getAllProductsForCatalogVersion(CatalogVersionModel catalogVersion)
Returns allProductModel
list belonging to the specifiedCatalogVersionModel
java.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.UnitModel
getOrderableUnit(ProductModel product)
Deprecated.since agesProductModel
getProduct(CatalogVersionModel catalogVersion, java.lang.String code)
Deprecated.since agesProductModel
getProduct(java.lang.String code)
Deprecated.since agesprotected ProductDao
getProductDao()
ProductModel
getProductForCode(CatalogVersionModel catalogVersion, java.lang.String code)
Returns the Product with the specified code belonging to the specified CatalogVersion.ProductModel
getProductForCode(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.Integer
getProductsCountForCategory(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.UnitModel
getUnit(java.lang.String code)
Deprecated.since agesvoid
setPriceService(PriceService priceService)
Deprecated.since agesvoid
setProductDao(ProductDao productDao)
void
setUnitDao(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:ProductService
Returns 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:
getProductForCode
in 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:
getProduct
in 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:ProductService
Returns for the givenproduct
the first foundUnitModel
from the PriceInformations of the product.- Specified by:
getOrderableUnit
in interfaceProductService
- Parameters:
product
- theProductModel
- Returns:
ProductModel.UNIT
if no PriceInformations is available at theProductModel
-
getAllProductsCountForCategory
public java.lang.Integer getAllProductsCountForCategory(CategoryModel category)
Description copied from interface:ProductService
Counts all products of the specificCategoryModel
excluding double linked products. This includes all its own products and products belonging to any sub category.- Specified by:
getAllProductsCountForCategory
in interfaceProductService
- Parameters:
category
- theCategoryModel
- Returns:
- amount of all products of the category
-
getProductsCountForCategory
public java.lang.Integer getProductsCountForCategory(CategoryModel category)
Description copied from interface:ProductService
Counts all products of the specificCategoryModel
.- Specified by:
getProductsCountForCategory
in interfaceProductService
- Parameters:
category
- theCategoryModel
- Returns:
- amount of all products of the category
-
containsProductsForCategory
public boolean containsProductsForCategory(CategoryModel category)
Description copied from interface:ProductService
Checks whether or not the specificCategoryModel
or any of its sub-categories contains at least one product.- Specified by:
containsProductsForCategory
in interfaceProductService
- Parameters:
category
- theCategoryModel
- Returns:
- true if at least one product belong the the
CategoryModel
or any of its sub-categories, false otherwise.
-
getUnit
@Deprecated public UnitModel getUnit(java.lang.String code)
Deprecated.since ages- Specified by:
getUnit
in 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:
getProduct
in 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:ProductService
Returns the Product with the specified code belonging to the specified CatalogVersion.- Specified by:
getProductForCode
in 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:
getProducts
in 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:ProductService
Returns 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:
getProductsForCategory
in 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:
getProducts
in 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:ProductService
Returns 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:
getProductsForCategory
in 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:ProductService
Returns all online products that belong to the specified category.- Specified by:
getOnlineProductsForCategory
in 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:ProductService
Returns all offline products that belong to the specified category.- Specified by:
getOfflineProductsForCategory
in 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:ProductService
Returns allProductModel
list belonging to the specifiedCatalogVersionModel
- Specified by:
getAllProductsForCatalogVersion
in 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
-
-