Class ProductManager
- All Implemented Interfaces:
ItemLifecycleListener,Serializable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classDeprecated.since ages - as of release 4.3, no replacementNested classes/interfaces inherited from class de.hybris.platform.jalo.Manager
Manager.GenericManagerSingletonCreator, Manager.ManagerSingletonCreator -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.since ages - as of release 4.3, please useProductServiceinstead -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckBeforeItemRemoval(SessionContext ctx, Item item) Deprecated.since ages - as of release 4.3, no replacementcreateProduct(SessionContext ctx, PK pk, String code) Deprecated.since ages - as of release 4.3, no replacement, please createProductModelusingModelService.create(Class)createProduct(SessionContext ctx, PK pkBase, String code, ComposedType type) Deprecated.since ages - as of release 4.3, no replacement, please createProductModelusingModelService.create(Class)createProduct(SessionContext ctx, String code) Deprecated.since ages - as of release 4.3, no replacement, please createProductModelusingModelService.create(Class)createProduct(SessionContext ctx, String code, ComposedType type) Deprecated.since ages - as of release 4.3, no replacement, please createProductModelusingModelService.create(Class)createProduct(String code) Deprecated.since ages - as of release 4.3, no replacement, please createProductModelusingModelService.create(Class)createUnit(PK pkBase, String type, String code) Deprecated.since ages - as of release 4.3, no replacement, please createUnitModelusingModelService.create(Class)createUnit(String type, String code) Deprecated.since agesDeprecated.since ages - as of release 4.3, please write your own flexible search queryDeprecated.since ages - as of release 4.3, please write your own flexible search queryDeprecated.since ages - as of release 4.3, please useUnitService.getAllUnits()Deprecated.since ages - as of release 4.3, please useUnitService.getAllUnitTypes()static ProductManagerDeprecated.since ages - as of release 4.3, please useProductServiceinsteadgetProductByPK(PK pk) Deprecated.since ages - as of release 4.3, please useModelService.get(PK)getProductsByCode(String filter) Deprecated.since ages - as of release 4.3, no replacement, instead please useProductService.getProduct(String)orProductService.getProduct(de.hybris.platform.catalog.model.CatalogVersionModel, String)protected StringDeprecated.since ages - as of release 4.3, please useProductModel._TYPECODEintDeprecated.since ages - as of release 4.3, no replacement because products are catalog aware, please write your own flexible search query.Deprecated.since ages - as of release 4.3, please useModelService.get(PK)) insteadDeprecated.since ages - as of release 4.3, please useUnitService.getUnitForCode(String)Deprecated.since ages - as of release 4.3, please useUnitService.getUnitForCode(String)as code is unique, type is not usefulgetUnitsByCode(String code) Deprecated.since ages - as of release 4.3, please useUnitService.getUnitForCode(String)as code is unique it returns single valuegetUnitsByTypeAndCode(String type, String code) Deprecated.since ages - as of release 4.3, please useUnitService.getUnitForCode(String)as code is unique, type is not usefulgetUnitsByUnitType(String type) Deprecated.since ages - as of release 4.3, please useUnitService.getUnitsForUnitType(String)protected StringDeprecated.since ages - as of release 4.3, please useUnitModel._TYPECODEprotected voidnotifyItemRemoval(SessionContext ctx, Item item) Deprecated.since ages - as of release 4.3, no replacementsearchUnits(String code, String type) Deprecated.as of release 4.3, since code is unique it's uselessDeprecated.since ages - as of release 4.3, no replacementMethods inherited from class de.hybris.platform.jalo.Manager
afterItemCreation, beforeItemCreation, destroy, extractNonRequiredRemoteFromItem, extractRequiredRemoteFromItem, getAllValuesSessionContext, getAttribute, getAttributeMap, getFirstItemByAttribute, getFirstItemByAttribute, getRemote, getRemoteManagerClass, getSession, getSingletonManagerInstance, getTenant, getTransientObject, getTransientObjectMap, init, setAttribute, setTenant, setTransientObject, wrap
-
Field Details
-
BEAN_NAME
Deprecated.since ages - as of release 4.3, please useProductServiceinstead- See Also:
-
-
Constructor Details
-
ProductManager
public ProductManager()Deprecated.
-
-
Method Details
-
getInstance
Deprecated.since ages - as of release 4.3, please useProductServiceinstead- Returns:
- instance of this manager
-
checkBeforeItemRemoval
@Deprecated(since="ages", forRemoval=false) protected void checkBeforeItemRemoval(SessionContext ctx, Item item) throws ConsistencyCheckException Deprecated.since ages - as of release 4.3, no replacementSuperclass method overridden to avoid call to EJB layer
Description copied from class:ManagerTODO improve API doc Override this method to implement pre-removal consistency checks. This method is called upon eachManagerand allows aborting removal by throwing aConsistencyCheckException. If no manager did so each one is notified by callingManager.notifyItemRemoval(SessionContext, Item).This method does nothing and may be overridden.
- Overrides:
checkBeforeItemRemovalin classManager- Parameters:
ctx- the current session contextitem- the item which should be removed- Throws:
ConsistencyCheckException- thrown to abort removal due to consistency errors- Since:
- 2.10
-
notifyItemRemoval
@Deprecated(since="ages", forRemoval=false) protected void notifyItemRemoval(SessionContext ctx, Item item) Deprecated.since ages - as of release 4.3, no replacementSuperclass method overridden to avoid call to EJB layer
Description copied from class:ManagerTODO improve API doc Is called just before a item is being removed. No exception should be thrown here. UseManager.checkBeforeItemRemoval(SessionContext, Item)instead.This method does nothing and may be overridden.
- Overrides:
notifyItemRemovalin classManager- Parameters:
ctx- the currency session contextitem- the item which is going to be removed- Since:
- 2.10
-
getProductTypeCode
Deprecated.since ages - as of release 4.3, please useProductModel._TYPECODE -
getUnitTypeCode
Deprecated.since ages - as of release 4.3, please useUnitModel._TYPECODE -
getProductByPK
@Deprecated(since="ages", forRemoval=false) public Product getProductByPK(PK pk) throws JaloItemNotFoundException Deprecated.since ages - as of release 4.3, please useModelService.get(PK)convenience method for getting a product this method just calls
- Parameters:
pk- the PK of the product- Returns:
- the product
- Throws:
JaloItemNotFoundException- if item was not foundClassCastException- if item was not product- See Also:
-
createProduct
@Deprecated(since="ages", forRemoval=false) public Product createProduct(SessionContext ctx, String code) Deprecated.since ages - as of release 4.3, no replacement, please createProductModelusingModelService.create(Class)Creates a new
Product.- Parameters:
ctx- the session contextcode- the code of the new product (not unique)- Returns:
- the new
Product
-
createProduct
@Deprecated(since="ages", forRemoval=false) public Product createProduct(SessionContext ctx, PK pk, String code) Deprecated.since ages - as of release 4.3, no replacement, please createProductModelusingModelService.create(Class)Creates a new
Product.- Parameters:
ctx- the session contextpk- the pk for the new item; it will be equipped with type code additionally (- ) code- the code of the new product (not unique)- Returns:
- the new
Product
-
createProduct
@Deprecated(since="ages", forRemoval=false) public Product createProduct(SessionContext ctx, String code, ComposedType type) Deprecated.since ages - as of release 4.3, no replacement, please createProductModelusingModelService.create(Class)Creates a new
Productwith a specified type.Please note that this does not include setting any attribute declared by this type! use
ComposedType.newInstance(Map)instead.- Parameters:
ctx- theSessionContextcode- the code of the new producttype- the type of the new product- Returns:
- the new
Product
-
createProduct
@Deprecated(since="ages", forRemoval=false) public Product createProduct(SessionContext ctx, PK pkBase, String code, ComposedType type) Deprecated.since ages - as of release 4.3, no replacement, please createProductModelusingModelService.create(Class)Creates a new
Productwith a specified type.- Parameters:
ctx- theSessionContextpkBase- the pk for the new item; it will be equipped with type code additionally (- ) code- the code of the new producttype- the type of the new product- Returns:
- the new
Product
-
getAllProducts
Deprecated.since ages - as of release 4.3, please write your own flexible search queryReturns a
Collectionof allProducts.- Returns:
- a
Collectioncontaining allProducts.
-
getProductsByCode
Deprecated.since ages - as of release 4.3, no replacement, instead please useProductService.getProduct(String)orProductService.getProduct(de.hybris.platform.catalog.model.CatalogVersionModel, String)Returns all products whose code match the given string. It will be performed a search with equal sign (WHERE code='filter') except you use the wildcard sign '%' or '_', then a like query will be used (WHERE code LIKE 'filter').
If you use wildcards be aware of a lower performance!- Parameters:
filter- the searched code. TheStringcan contain%characters as wildcard. Using%hybris%as the filter would return all Products whose code containshybris. Be aware of lower performance if using wildcards- Returns:
- a
Collectionof all Products whose code matches the given filter.
-
getQuantityOfProducts
Deprecated.since ages - as of release 4.3, no replacement because products are catalog aware, please write your own flexible search query.Returns the total number of products.
- Returns:
- the total number of products.
-
createProduct
Deprecated.since ages - as of release 4.3, no replacement, please createProductModelusingModelService.create(Class)Creates a new
Product.- Parameters:
code- the code of the new product (not unique)- Returns:
- the new
Product
-
getUnit
@Deprecated(since="ages", forRemoval=false) public Unit getUnit(PK pk) throws JaloItemNotFoundException Deprecated.since ages - as of release 4.3, please useModelService.get(PK)) instead- Parameters:
pk- thePKof the searchedUnit- Returns:
- the
Unitwith the specifiedPK - Throws:
JaloItemNotFoundException- if there is noUnitwith the specifiedPK
-
searchUnits
Deprecated.as of release 4.3, since code is unique it's uselessSearches units by code and type.
- Parameters:
code- the unit code (null ignores the field)type- the unit type (null ignores the field)- Returns:
- a
Collectionof all units matching the given code and type.
-
createUnit
Deprecated.since ages* @deprecated as of release 4.3, no replacement, please createUnitModelusingModelService.create(Class)Create a new
Unitwith the given type and code- Parameters:
type- the type of the newUnitcode- the code of the newUnit- Returns:
- the new
Unit
-
createUnit
@Deprecated(since="ages", forRemoval=false) public Unit createUnit(PK pkBase, String type, String code) Deprecated.since ages - as of release 4.3, no replacement, please createUnitModelusingModelService.create(Class)Create a new
Unitwith the given type and code- Parameters:
pkBase- the pk for the new item; it will be equipped with type code additionally (- ) type- the type of the newUnitcode- the code of the newUnit- Returns:
- the new
Unit
-
getAllUnits
Deprecated.since ages - as of release 4.3, please useUnitService.getAllUnits()Returns all Units.
- Returns:
- a
Collectioncontaining all units.
-
getUnitsByUnitType
Deprecated.since ages - as of release 4.3, please useUnitService.getUnitsForUnitType(String)Returns a
Collectionof all units of one type (e.g. 'weight' ).- Parameters:
type- the type of the searches units.- Returns:
- a
Collectionof all units of one type (e.g. 'weight' ).
-
getUnit
Deprecated.since ages - as of release 4.3, please useUnitService.getUnitForCode(String)Convernience method for fetching one unit provided that the given unit code is unique.
- Parameters:
code- the unit code- Returns:
- the unit or
nullif no such unit exists - Throws:
JaloInvalidParameterException- if the unit code is not unique
-
getUnitsByCode
Deprecated.since ages - as of release 4.3, please useUnitService.getUnitForCode(String)as code is unique it returns single value -
getUnit
Deprecated.since ages - as of release 4.3, please useUnitService.getUnitForCode(String)as code is unique, type is not usefulConvenience method for fetching one unit provided that the given unit code and type combination is unique.
- Parameters:
type- the unit typecode- the unit code- Returns:
- the unit or
nullif no such unit exists - Throws:
JaloInvalidParameterException- if the unit code and type combination is not unique
-
getUnitsByTypeAndCode
@Deprecated(since="ages", forRemoval=false) public Collection<Unit> getUnitsByTypeAndCode(String type, String code) Deprecated.since ages - as of release 4.3, please useUnitService.getUnitForCode(String)as code is unique, type is not useful -
getAllUnitTypes
Deprecated.since ages - as of release 4.3, please useUnitService.getAllUnitTypes()Finds all unit types (e.g. 'weight', 'size' ).
- Returns:
- a collection of type strings
-
getAllProductsChangedAfter
Deprecated.since ages - as of release 4.3, please write your own flexible search queryGet all products that have been modified since the given time
- Parameters:
date- the date- Returns:
- a collection of
Products
-
writeReplace
@Deprecated(since="ages", forRemoval=false) public Object writeReplace() throws ObjectStreamExceptionDeprecated.since ages - as of release 4.3, no replacement- Specified by:
writeReplacein classManager- Throws:
ObjectStreamException
-
ProductServiceThe ProductManager is used to create and find Products, Bundles, Variants and Units.