Class Order

All Implemented Interfaces:
Serializable, Comparable
Direct Known Subclasses:
GeneratedReturnOrder, TestOrder

public class Order extends GeneratedOrder

The concrete order class of the hybris Platform. These objects are stored and managed by OrderManager.

This class also defined search context parameter for OrderManager.searchOrders(de.hybris.platform.jalo.SearchContext).

See Also:
  • Field Details

  • Constructor Details

    • Order

      public Order()
  • Method Details

    • createItem

      protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException
      Description copied from class: Item
      Has to be implemented for each concrete subtype of item. This method is responsible for creating a new item instance ( by calling managers, ejb homes, etc. ) during ComposedType.newInstance(Map).

      In case this method uses any of the attribute values during creation it is required to override Item.getNonInitialAttributes(SessionContext, ItemAttributeMap) too.
      Sn example:

      
       public static final String MY_ATTRIBUTE = "someAttribute"; ... protected Item createItem(SessionContext
       ctx, ComposedType type, Map allAttributes ) throws JaloBusinessException { MyManager man = ... return
       man.createMyItem( (String)allAttributes.get(MY_ATTRIBUTE) );
       // here MY_ATTRIBUTE is used for creation, so it must not be set again } protected Map getNonInitialAttributes(
       SessionContext ctx, Map allAttributes ) { // let superclass remove its own initial attributes Map ret =
       super.getNonInitialAttributes( ctx, allAttributes );
       // remove MY_ATTRIBUTE from all attributes since if has already been set ret.remove(MY_ATTRIBUTE); return ret; }
      
       
      Overrides:
      createItem in class GeneratedOrder
      Parameters:
      ctx - the current session context which this item is created within
      type - the actual item type ( since subtypes may not provide a own jalo class this may be different from the type which this method was implemented for )
      Returns:
      the new item instance
      Throws:
      JaloBusinessException - indicates an error during creation - any changes will be rollbacked
    • getDefaultAttributeModes

      protected Map<String,Item.AttributeMode> getDefaultAttributeModes()
      Overrides:
      getDefaultAttributeModes in class GeneratedOrder
    • getAbstractOrderEntryTypeCode

      protected String getAbstractOrderEntryTypeCode()
      Specified by:
      getAbstractOrderEntryTypeCode in class AbstractOrder
    • setPaymentAddress

      public void setPaymentAddress(Address adr)
      Contrary to AbstractOrder.setPaymentAddress(Address) this method copies the given address and assigns the copied address as payment address!
      Overrides:
      setPaymentAddress in class AbstractOrder
      Parameters:
      adr - the address to create a copy of which is assigned as payment address
    • setPaymentAddressNoCopy

      public void setPaymentAddressNoCopy(Address address)
      Directly assigns the given address as payment address without copying it. Please be aware that this may the address data cannot be protected against changes since it may still belong to the user and subject to his modifications.
      Parameters:
      address - the address to assign
    • setPaymentAddress

      public void setPaymentAddress(SessionContext ctx, Address address)
      Contrary to AbstractOrder.setPaymentAddress(Address) this method copies the given address and assigns the copied address as payment address!
      Overrides:
      setPaymentAddress in class AbstractOrder
      Parameters:
      ctx - the session context
      address - the address to create a copy of which is assigned as payment address
    • changePaymentAddress

      protected void changePaymentAddress(SessionContext ctx, Address address, Address oldOne)
    • removeOldCopyAddress

      protected void removeOldCopyAddress(SessionContext ctx, Address oldOne)
    • copyAddressIfNecessary

      protected Address copyAddressIfNecessary(SessionContext ctx, Address original)
    • removeOldCopyPaymentInfo

      protected void removeOldCopyPaymentInfo(SessionContext ctx, PaymentInfo oldOne)
    • copyPaymentInfoIfNecessary

      protected PaymentInfo copyPaymentInfoIfNecessary(SessionContext ctx, PaymentInfo original)
    • setPaymentAddressNoCopy

      public void setPaymentAddressNoCopy(SessionContext ctx, Address address)
      Directly assigns the given address as payment address without copying it. Please be aware that this may the address data cannot be protected against changes since it may still belong to the user and subject to his modifications.
      Parameters:
      ctx - the session context
      address - the address to assign
    • setDeliveryAddress

      public void setDeliveryAddress(Address adr)
      Contrary to AbstractOrder.setDeliveryAddress(Address) this method copies the given address and assigns the copied address as delivery address!
      Overrides:
      setDeliveryAddress in class AbstractOrder
      Parameters:
      adr - the address to create a copy of which is assigned as delivery address
    • setDeliveryAddressNoCopy

      public void setDeliveryAddressNoCopy(Address address)
      Directly assigns the given address as delivery address without copying it. Please be aware that this may the address data cannot be protected against changes since it may still belong to the user and subject to his modifications.
      Parameters:
      address - the address to assign
    • setDeliveryAddress

      public void setDeliveryAddress(SessionContext ctx, Address address)
      Contrary to AbstractOrder.setDeliveryAddress(SessionContext, Address) this method copies the given address and assigns the copied address as delivery address!
      Overrides:
      setDeliveryAddress in class AbstractOrder
      Parameters:
      ctx - the session context
      address - the address to create a copy of which is assigned as delivery address
    • changeDeliveryAddress

      protected void changeDeliveryAddress(SessionContext ctx, Address address, Address oldOne)
    • setDeliveryAddressNoCopy

      public void setDeliveryAddressNoCopy(SessionContext ctx, Address address)
      Directly assigns the given address as delivery address without copying it. Please be aware that this may the address data cannot be protected against changes since it may still belong to the user and subject to his modifications.
      Parameters:
      ctx - the session context
      address - the address to assign
    • setPaymentInfo

      public void setPaymentInfo(PaymentInfo info)
      Contrary to GeneratedAbstractOrder.setPaymentInfo(PaymentInfo) this method copies the given payment info and assigns the copy as info item!
      Overrides:
      setPaymentInfo in class GeneratedAbstractOrder
      Parameters:
      info - the payment info to create a copy of which is assigned as info
    • setPaymentInfoNoCopy

      public void setPaymentInfoNoCopy(PaymentInfo info)
      Directly assigns the given payment info without copying it. Please be aware that this may the info data cannot be protected against changes since it may still belong to the user and subject to his modifications.
      Parameters:
      info - the payment info to assign
    • setPaymentInfo

      public void setPaymentInfo(SessionContext ctx, PaymentInfo info)
      Contrary to GeneratedAbstractOrder.setPaymentInfo(SessionContext, PaymentInfo) this method copies the given payment info and assigns the copy as info item!
      Overrides:
      setPaymentInfo in class GeneratedAbstractOrder
      Parameters:
      ctx - the session context
      info - the payment info to create a copy of which is assigned as info
    • changePaymentInfo

      protected void changePaymentInfo(SessionContext ctx, PaymentInfo info, PaymentInfo oldOne)
    • setPaymentInfoNoCopy

      public void setPaymentInfoNoCopy(SessionContext ctx, PaymentInfo info)
      Directly assigns the given payment info without copying it. Please be aware that this may the info data cannot be protected against changes since it may still belong to the user and subject to his modifications.
      Parameters:
      ctx - the session context
      info - the payment info to assign
    • createNewEntry

      protected OrderEntry createNewEntry(SessionContext ctx, ComposedType entryType, Product product, long quantity, Unit unit, int position)
      Specified by:
      createNewEntry in class AbstractOrder
    • remove

      public void remove(SessionContext ctx) throws ConsistencyCheckException
      Description copied from class: Item
      Removes this item.

      This method is using the following attributes of the given SessionContext:

      CacheUsage   Language   StagingMethod
      n/a (this is a setter method)   no, language doesn't matter for removal   yes if called on a StageableItem, no otherwise


      Overrides:
      remove in class AbstractOrder
      Parameters:
      ctx - A SessionContext object
      Throws:
      ConsistencyCheckException - if this item could not be removed for some reason