Class DefaultProductDao
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.dao.DefaultGenericDao<ProductModel>
-
- de.hybris.platform.product.daos.impl.DefaultProductDao
-
- All Implemented Interfaces:
ProductDao
,Dao
,GenericDao<ProductModel>
public class DefaultProductDao extends DefaultGenericDao<ProductModel> implements ProductDao
Default implementation of theProductDao
.
-
-
Constructor Summary
Constructors Constructor Description DefaultProductDao(java.lang.String typecode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Integer
findAllProductsCountByCategory(CategoryModel category)
Counts all products of the specificCategoryModel
excluding double linked products.java.util.List<ProductModel>
findOfflineProductsByCategory(CategoryModel category)
Returns all offline products that belong to the specified category.java.util.List<ProductModel>
findOnlineProductsByCategory(CategoryModel category)
Returns all online products that belong to the specified category.java.util.List<ProductModel>
findProducts(CategoryModel category, boolean online)
java.util.List<ProductModel>
findProductsByCatalogVersion(CatalogVersionModel catalogVersion)
Returns for the given productcatalogVersion
theProductModel
collection.SearchResult<ProductModel>
findProductsByCategory(CategoryModel category, int start, int count)
Returns for the givenCategoryModel
and all sub categories all foundProductModel
s.java.util.List<ProductModel>
findProductsByCode(CatalogVersionModel catalogVersion, java.lang.String code)
java.util.List<ProductModel>
findProductsByCode(java.lang.String code)
Returns for the given productcode
theProductModel
collection.java.lang.Integer
findProductsCountByCategory(CategoryModel category)
Counts all products of the specificCategoryModel
-
Methods inherited from class de.hybris.platform.servicelayer.internal.dao.DefaultGenericDao
find, find, find, find, find, getFlexibleSearchService, setFlexibleSearchService
-
-
-
-
Method Detail
-
findProductsByCategory
public SearchResult<ProductModel> findProductsByCategory(CategoryModel category, int start, int count)
Description copied from interface:ProductDao
Returns for the givenCategoryModel
and all sub categories all foundProductModel
s.- Specified by:
findProductsByCategory
in interfaceProductDao
- Parameters:
category
- the (root) category in which the search for the products startsstart
- the start number of the search range. Set this value to 0 for getting all products.count
- the number of elements in the search range. Set this value to -1 for getting all products.- Returns:
- a
SearchResult
with the found results. A SearchResult is used for the paging (start,count) of the elements.
-
findProducts
public java.util.List<ProductModel> findProducts(CategoryModel category, boolean online)
- Specified by:
findProducts
in interfaceProductDao
- Parameters:
category
- the category the returned products belong toonline
- true for online products, or false for offline products- Returns:
- all found products that belong to the specified category, or empty list if no product can be found.
-
findProductsByCode
public java.util.List<ProductModel> findProductsByCode(java.lang.String code)
Description copied from interface:ProductDao
Returns for the given productcode
theProductModel
collection.- Specified by:
findProductsByCode
in interfaceProductDao
- Parameters:
code
- the productcode
- Returns:
- a
ProductModel
-
findProductsByCatalogVersion
public java.util.List<ProductModel> findProductsByCatalogVersion(CatalogVersionModel catalogVersion)
Description copied from interface:ProductDao
Returns for the given productcatalogVersion
theProductModel
collection.- Specified by:
findProductsByCatalogVersion
in interfaceProductDao
- Parameters:
catalogVersion
- the productcatalogVersion
- Returns:
- a
ProductModel
-
findProductsByCode
public java.util.List<ProductModel> findProductsByCode(CatalogVersionModel catalogVersion, java.lang.String code)
Description copied from interface:ProductDao
- Specified by:
findProductsByCode
in interfaceProductDao
- Parameters:
catalogVersion
- the catalog versioncode
- the product code- Returns:
- a
ProductModel
-
findAllProductsCountByCategory
public java.lang.Integer findAllProductsCountByCategory(CategoryModel category)
Description copied from interface:ProductDao
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:
findAllProductsCountByCategory
in interfaceProductDao
- Returns:
- amount of all products of the category.
-
findProductsCountByCategory
public java.lang.Integer findProductsCountByCategory(CategoryModel category)
Description copied from interface:ProductDao
Counts all products of the specificCategoryModel
- Specified by:
findProductsCountByCategory
in interfaceProductDao
- Returns:
- amount of all products of the category.
-
findOfflineProductsByCategory
public java.util.List<ProductModel> findOfflineProductsByCategory(CategoryModel category)
Description copied from interface:ProductDao
Returns all offline products that belong to the specified category.- Specified by:
findOfflineProductsByCategory
in interfaceProductDao
- Parameters:
category
- the category the returned products belong to- Returns:
- all found products that belong to the specified category, or empty list if no product can be found.
-
findOnlineProductsByCategory
public java.util.List<ProductModel> findOnlineProductsByCategory(CategoryModel category)
Description copied from interface:ProductDao
Returns all online products that belong to the specified category.- Specified by:
findOnlineProductsByCategory
in interfaceProductDao
- Parameters:
category
- the category the returned products belong to- Returns:
- all found products that belong to the specified category, or empty list if no product can be found.
-
-