SaveAbstractOrderStrategy
SaveAbstractOrderStrategy is responsible for persisting the given AbstractOrderModel instances.
public interface SaveAbstractOrderStrategy<O>
{
/**
* Saves the given order model and the order entries.
*
* @param order
* order model
* @return saved and refreshed order model
*/
O saveOrder(final O order);
}
Usually, you could persist the order models using standard method like calling save() method from the ModelService. But for such important data like orders it might happen that there is a need of some special saving logic. The default implementation tries to save the order and the entries within one transaction and refresh the models.
If you want to replace the saving strategy in the framework with your own implementation (or the default extension of DefaultSaveAbstractOrderStrategy), you can provide an implementation of the de.hybris.platform.order.strategies.saving.SaveAbstractOrderStrategy and configure it in the spring configuration of your extension.
public class MySaveAbstractOrderStrategy extends DefaultSaveAbstractOrderStrategy
implements SaveAbstractOrderStrategy
{
...
}
<alias alias="saveAbstractOrderStrategy" name="mySaveAbstractOrderStrategy"/> <bean id="mySaveAbstractOrderStrategy" class="de.hybris.platform.order.strategies.saving.impl.MySaveAbstractOrderStrategy" parent="defaultSaveAbstractOrderStrategy"> <!-- inject whatever you need to use in your implementation --> </bean>