Class DefaultAbstractOrderPrepareInterceptor
java.lang.Object
de.hybris.platform.order.interceptors.AbstractAttributesModificationAwareInterceptor
de.hybris.platform.order.interceptors.DefaultAbstractOrderPrepareInterceptor
- All Implemented Interfaces:
Interceptor,PrepareInterceptor
public class DefaultAbstractOrderPrepareInterceptor
extends AbstractAttributesModificationAwareInterceptor
implements PrepareInterceptor
For a new
AbstractOrderModel the interceptor adjusts the AbstractOrderModel.CODE according to the
configured KeyGenerator. It also sets a default value of AbstractOrderModel.CALCULATED flag.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<String>returns qualifiers of order attributes, which, when modified, the order and orderEntries need to be recalculated.protected Collection<String>returns qualifiers of order attributes, which, when modified, the order needs to be recalculated.org.apache.log4j.Loggerprotected booleanAs all of the order calculation is moved to the SL we can do the calculation and set the calculated flag in a single database update.voidonPrepare(Object model, InterceptorContext ctx) Called in themodelService.saveAll()method.voidsetAttributesForOrderEntriesRecalculation(Collection<String> attributesForOrderEntriesRecalculation) voidsetAttributesForOrderRecalculation(Collection<String> attributesForOrderRecalculation) voidsetKeyGenerator(KeyGenerator keyGenerator) Methods inherited from class de.hybris.platform.order.interceptors.AbstractAttributesModificationAwareInterceptor
isAttributeModified, isOneOfAttributesModified
-
Constructor Details
-
DefaultAbstractOrderPrepareInterceptor
public DefaultAbstractOrderPrepareInterceptor()
-
-
Method Details
-
onPrepare
Description copied from interface:PrepareInterceptorCalled in themodelService.saveAll()method. Prepares the values of the given model.- Specified by:
onPreparein interfacePrepareInterceptor- Parameters:
model- the model which values has to be preparedctx- theInterceptorContext- Throws:
InterceptorException- if an error occured during the preparation
-
getAttributesForOrderEntriesRecalculation
returns qualifiers of order attributes, which, when modified, the order and orderEntries need to be recalculated. -
getAttributesForOrderRecalculation
returns qualifiers of order attributes, which, when modified, the order needs to be recalculated. -
isCalculatedFlagUnchangedOrFalse
protected boolean isCalculatedFlagUnchangedOrFalse(AbstractOrderModel order, InterceptorContext ctx) As all of the order calculation is moved to the SL we can do the calculation and set the calculated flag in a single database update. Therefore if the order has the calculated flag to to true we trust that the order is already calculated and therefore let the flag be persisted -
setKeyGenerator
-
setAttributesForOrderRecalculation
-
setAttributesForOrderEntriesRecalculation
public void setAttributesForOrderEntriesRecalculation(Collection<String> attributesForOrderEntriesRecalculation) -
getLogger
public org.apache.log4j.Logger getLogger()- Specified by:
getLoggerin classAbstractAttributesModificationAwareInterceptor
-