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 newAbstractOrderModelthe interceptor adjusts theAbstractOrderModel.CODEaccording to the configuredKeyGenerator. It also sets a default value ofAbstractOrderModel.CALCULATEDflag.
-
-
Constructor Summary
Constructors Constructor Description DefaultAbstractOrderPrepareInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Collection<java.lang.String>getAttributesForOrderEntriesRecalculation()returns qualifiers of order attributes, which, when modified, the order and orderEntries need to be recalculated.protected java.util.Collection<java.lang.String>getAttributesForOrderRecalculation()returns qualifiers of order attributes, which, when modified, the order needs to be recalculated.org.apache.log4j.LoggergetLogger()protected booleanisCalculatedFlagUnchangedOrFalse(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.voidonPrepare(java.lang.Object model, InterceptorContext ctx)Called in themodelService.saveAll()method.voidsetAttributesForOrderEntriesRecalculation(java.util.Collection<java.lang.String> attributesForOrderEntriesRecalculation)voidsetAttributesForOrderRecalculation(java.util.Collection<java.lang.String> attributesForOrderRecalculation)voidsetKeyGenerator(KeyGenerator keyGenerator)-
Methods inherited from class de.hybris.platform.order.interceptors.AbstractAttributesModificationAwareInterceptor
isAttributeModified, isOneOfAttributesModified
-
-
-
-
Method Detail
-
onPrepare
public void onPrepare(java.lang.Object model, InterceptorContext ctx) throws InterceptorExceptionDescription 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
protected java.util.Collection<java.lang.String> getAttributesForOrderEntriesRecalculation()
returns qualifiers of order attributes, which, when modified, the order and orderEntries need to be recalculated.
-
getAttributesForOrderRecalculation
protected java.util.Collection<java.lang.String> 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
public void setKeyGenerator(KeyGenerator keyGenerator)
-
setAttributesForOrderRecalculation
public void setAttributesForOrderRecalculation(java.util.Collection<java.lang.String> attributesForOrderRecalculation)
-
setAttributesForOrderEntriesRecalculation
public void setAttributesForOrderEntriesRecalculation(java.util.Collection<java.lang.String> attributesForOrderEntriesRecalculation)
-
getLogger
public org.apache.log4j.Logger getLogger()
- Specified by:
getLoggerin classAbstractAttributesModificationAwareInterceptor
-
-