Package de.hybris.platform.order.impl
Class DefaultAbstractOrderEntryService<T extends AbstractOrderEntryModel>
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.service.AbstractService
-
- de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
-
- de.hybris.platform.order.impl.DefaultAbstractOrderEntryService<T>
-
- All Implemented Interfaces:
AbstractOrderEntryService<T>,java.io.Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
DefaultCartEntryService,DefaultOrderEntryService
public class DefaultAbstractOrderEntryService<T extends AbstractOrderEntryModel> extends AbstractBusinessService implements AbstractOrderEntryService<T>
Default implementation ofAbstractOrderEntryService. Provides implementation onAbstractOrderEntryModeltype level.- 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 Modifier and Type Field Description protected AbstractOrderEntryTypeServiceabstractOrderEntryTypeService-
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 DefaultAbstractOrderEntryService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAllDiscountValues(T entry, java.util.List<DiscountValue> discountValues)Adds a collection of discount values into given entry.voidaddAllTaxValues(T entry, java.util.List<TaxValue> taxValues)Adds a collection of tax values into given entry.voidaddDiscountValue(T entry, DiscountValue discountValue)Adds a new discount value to the given entry.voidaddTaxValue(T entry, TaxValue taxValue)Adds a new tax value into given entry.TcreateEntry(AbstractOrderModel order)Creates a new instance of order entry for a given abstract order instance.AbstractOrderEntryModelcreateEntry(ComposedTypeModel entryType, AbstractOrderModel order)Creates a new instance of abstract order entry of the specific composed type for a given order instance.DiscountValuegetGlobalDiscountValue(T entry, DiscountValue discountValue)Searches for complete discount value (with calculated applied value) object created using given discountValue.voidremoveDiscountValue(T entry, DiscountValue discountValue)Removes given discount value from the given entry.voidremoveTaxValue(T entry, TaxValue taxValue)Removes given tax value from the given entry.voidsetAbstractOrderEntryTypeService(AbstractOrderEntryTypeService abstractOrderEntryTypeService)-
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
-
-
-
-
Field Detail
-
abstractOrderEntryTypeService
protected AbstractOrderEntryTypeService abstractOrderEntryTypeService
-
-
Method Detail
-
createEntry
public T createEntry(AbstractOrderModel order)
Description copied from interface:AbstractOrderEntryServiceCreates a new instance of order entry for a given abstract order instance. The entry type is chosen to best suit the order instance. New entry remains not persisted.- Specified by:
createEntryin interfaceAbstractOrderEntryService<T extends AbstractOrderEntryModel>- Parameters:
order- target order- Returns:
- new order entry of the suitable runtime type.
- See Also:
AbstractOrderEntryTypeService.getAbstractOrderEntryType(AbstractOrderModel)
-
createEntry
public AbstractOrderEntryModel createEntry(ComposedTypeModel entryType, AbstractOrderModel order)
Description copied from interface:AbstractOrderEntryServiceCreates a new instance of abstract order entry of the specific composed type for a given order instance. New entry remains not persisted.- Specified by:
createEntryin interfaceAbstractOrderEntryService<T extends AbstractOrderEntryModel>- Parameters:
entryType- create entry of this specific typeorder- target order- Returns:
- new abstract order entry of the specific runtime type.
-
addDiscountValue
public void addDiscountValue(T entry, DiscountValue discountValue)
Description copied from interface:AbstractOrderEntryServiceAdds a new discount value to the given entry. Entry remains not persisted. By default, after save operation, the entry will be not calculated. User needs to recalculate order in order to notice the added discount in the total price.- Specified by:
addDiscountValuein interfaceAbstractOrderEntryService<T extends AbstractOrderEntryModel>- Parameters:
entry- targetAbstractOrderEntryModeldiscountValue- discount value to add- See Also:
CalculationService.calculate(AbstractOrderModel)
-
addTaxValue
public void addTaxValue(T entry, TaxValue taxValue)
Description copied from interface:AbstractOrderEntryServiceAdds a new tax value into given entry. Entry remains not persisted. By default, after save operation, the entry will be not calculated. User needs to recalculate entry in order to notice the added tax value in the orders total tax. After recalculation of the order, the newTaxValueshould be present in orders tax valuesAbstractOrderModel.TOTALTAXVALUES.- Specified by:
addTaxValuein interfaceAbstractOrderEntryService<T extends AbstractOrderEntryModel>- Parameters:
entry- targetAbstractOrderEntryModeltaxValue- tax value to add- See Also:
CalculationService.calculate(AbstractOrderModel)
-
addAllDiscountValues
public void addAllDiscountValues(T entry, java.util.List<DiscountValue> discountValues)
Description copied from interface:AbstractOrderEntryServiceAdds a collection of discount values into given entry. Entry remains not persisted and not calculated. User needs to recalculate order in order to notice the added discounts in the total price.- Specified by:
addAllDiscountValuesin interfaceAbstractOrderEntryService<T extends AbstractOrderEntryModel>- Parameters:
entry- targetAbstractOrderEntryModeldiscountValues- discount values to add- See Also:
CalculationService.calculate(AbstractOrderModel)
-
addAllTaxValues
public void addAllTaxValues(T entry, java.util.List<TaxValue> taxValues)
Description copied from interface:AbstractOrderEntryServiceAdds a collection of tax values into given entry. Entry remains not persisted and not calculated. User needs to recalculate entry in order to notice the added tax values in the orders total tax. After recalculation of the order, the newTaxValues should be present in orders tax valuesAbstractOrderModel.TOTALTAXVALUES.- Specified by:
addAllTaxValuesin interfaceAbstractOrderEntryService<T extends AbstractOrderEntryModel>- Parameters:
entry- targetAbstractOrderEntryModeltaxValues- tax values to add- See Also:
CalculationService.calculate(AbstractOrderModel)
-
removeDiscountValue
public void removeDiscountValue(T entry, DiscountValue discountValue)
Description copied from interface:AbstractOrderEntryServiceRemoves given discount value from the given entry. Entry remains not persisted and not calculated. User needs to recalculate order in order to notice the removed discount in the total price.- Specified by:
removeDiscountValuein interfaceAbstractOrderEntryService<T extends AbstractOrderEntryModel>- Parameters:
entry- targetAbstractOrderEntryModeldiscountValue- discount value to remove- See Also:
CalculationService.calculate(AbstractOrderModel)
-
removeTaxValue
public void removeTaxValue(T entry, TaxValue taxValue)
Description copied from interface:AbstractOrderEntryServiceRemoves given tax value from the given entry. Entry remains not persisted and not calculated. User needs to recalculate entry in order to see the difference in order's total tax. After recalculation of the order, the removedTaxValueshould be removed from orders tax valuesAbstractOrderModel.TOTALTAXVALUES.- Specified by:
removeTaxValuein interfaceAbstractOrderEntryService<T extends AbstractOrderEntryModel>- Parameters:
entry- targetAbstractOrderEntryModeltaxValue- tax value to remove- See Also:
CalculationService.calculate(AbstractOrderModel)
-
setAbstractOrderEntryTypeService
public void setAbstractOrderEntryTypeService(AbstractOrderEntryTypeService abstractOrderEntryTypeService)
-
getGlobalDiscountValue
public DiscountValue getGlobalDiscountValue(T entry, DiscountValue discountValue)
Description copied from interface:AbstractOrderEntryServiceSearches for complete discount value (with calculated applied value) object created using given discountValue. Returns null when discount value for given parameter can not be found.- Specified by:
getGlobalDiscountValuein interfaceAbstractOrderEntryService<T extends AbstractOrderEntryModel>
-
-