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 Details

    • DefaultAbstractOrderPrepareInterceptor

      public DefaultAbstractOrderPrepareInterceptor()
  • Method Details

    • onPrepare

      public void onPrepare(Object model, InterceptorContext ctx) throws InterceptorException
      Description copied from interface: PrepareInterceptor
      Called in the modelService.saveAll() method. Prepares the values of the given model.
      Specified by:
      onPrepare in interface PrepareInterceptor
      Parameters:
      model - the model which values has to be prepared
      ctx - the InterceptorContext
      Throws:
      InterceptorException - if an error occured during the preparation
    • getAttributesForOrderEntriesRecalculation

      protected Collection<String> getAttributesForOrderEntriesRecalculation()
      returns qualifiers of order attributes, which, when modified, the order and orderEntries need to be recalculated.
    • getAttributesForOrderRecalculation

      protected Collection<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(Collection<String> attributesForOrderRecalculation)
    • setAttributesForOrderEntriesRecalculation

      public void setAttributesForOrderEntriesRecalculation(Collection<String> attributesForOrderEntriesRecalculation)
    • getLogger

      public org.apache.log4j.Logger getLogger()
      Specified by:
      getLogger in class AbstractAttributesModificationAwareInterceptor