Class BusinessObjectBase

java.lang.Object
de.hybris.platform.sap.core.bol.businessobject.BusinessObjectBase
All Implemented Interfaces:
BackendAware, BusinessObject, MessageListHolder, Serializable, Cloneable
Direct Known Subclasses:
AddressImpl, ConnectedObjectImpl, ConverterImpl, PartnerBaseImpl, SapCreditCheckBOImpl, SapInvoiceBOImpl, SapPricingImpl, SapProductAvailabilityBOImpl, SchedlineImpl, SearchImpl, SimpleDocumentImpl, SimpleHeaderImpl, SimpleItemImpl, TestBusinessObjectBaseBEDeterminationImpl, TestBusinessObjectBaseBEDeterminationNotFoundImpl, TestBusinessObjectBaseBEInjectionImpl, TestBusinessObjectBaseBENotUniqueDeterminationImpl, TestBusinessObjectBaseBESingleImplementationImpl, TransactionConfigurationImpl

public class BusinessObjectBase extends Object implements BusinessObject, BackendAware, Cloneable
Base implementation for business object interface.
See Also:
  • Field Details

    • techKey

      protected TechKey techKey
      Technical key.
    • handle

      protected String handle
      Temporary handle.
    • bobMessages

      protected MessageList bobMessages
      Business Object messages.
    • bobState

      protected int bobState
      Business Object state.
    • extensionData

      protected Map<String,Object> extensionData
      Extension data map.
    • backendType

      protected String backendType
      Backend type.
    • backendObject

      protected BackendBusinessObject backendObject
      Backend Object reference.
    • genericFactory

      protected GenericFactory genericFactory
      Generic Factory to create data container beans.
    • moduleConfigurationAccess

      protected ModuleConfigurationAccess moduleConfigurationAccess
      Access to module configuration data.
  • Constructor Details

    • BusinessObjectBase

      public BusinessObjectBase()
      Standard constructor.
  • Method Details

    • setGenericFactory

      public void setGenericFactory(GenericFactory genericFactory)
      Injection setter for GenericFactory.
      Parameters:
      genericFactory - GenericFactory
    • setModuleConfigurationAccess

      public void setModuleConfigurationAccess(ModuleConfigurationAccess moduleConfigurationAccess)
      Injection setter for ModuleConfigurationAccess.
      Parameters:
      moduleConfigurationAccess - the ModuleConfigurationAccess to set
    • setBackendObject

      public void setBackendObject(BackendBusinessObject backendObject)
      Set the current backend business object (optional).
      Parameters:
      backendObject - the backend business object to use
    • setBackendType

      public void setBackendType(String backendType)
      Set the current backend type.
      Parameters:
      backendType - backend type
    • init

      public void init()
      Description copied from interface: BusinessObject
      This method is called after all properties have been set It needs to be defined in the Spring bean definition as init-method.
      Specified by:
      init in interface BusinessObject
    • destroy

      public void destroy()
      Description copied from interface: BusinessObject
      This method is called before the bean is invalidated It needs to be defined in the Spring bean definition as destroy-method.
      Specified by:
      destroy in interface BusinessObject
    • getBackendType

      public String getBackendType()
      Get the current backend type.
      Returns:
      backend type
    • getBackendBusinessObject

      public BackendBusinessObject getBackendBusinessObject() throws BackendException
      Description copied from interface: BackendAware
      Returns the backend business object.
      Specified by:
      getBackendBusinessObject in interface BackendAware
      Returns:
      backend business object
      Throws:
      BackendException - BackendException
    • getBackendBusinessObject

      public BackendBusinessObject getBackendBusinessObject(boolean initialize) throws BackendException
      Description copied from interface: BackendAware
      Returns the backend business object.
      Specified by:
      getBackendBusinessObject in interface BackendAware
      Parameters:
      initialize - if true, backend object is re-created
      Returns:
      backend business object
      Throws:
      BackendException - BackendException
    • getTechKey

      public TechKey getTechKey()
      Description copied from interface: BusinessObject
      Retrieves the key for the object.
      Specified by:
      getTechKey in interface BusinessObject
      Returns:
      The object's key
    • setTechKey

      public void setTechKey(TechKey techKey)
      Description copied from interface: BusinessObject
      Sets the key for the document.
      Specified by:
      setTechKey in interface BusinessObject
      Parameters:
      techKey - Key to be set
    • createUniqueHandle

      public void createUniqueHandle()
      Description copied from interface: BusinessObject
      This method creates a unique handle, as an alternative key for the business object, because at the creation point no techkey for the object exists. Therefore maybay the handle is needed to identify the object in backend
      Specified by:
      createUniqueHandle in interface BusinessObject
    • setHandle

      public void setHandle(String handle)
      Description copied from interface: BusinessObject
      This method sets the handle, as an alternative key for the business object, because at the creation point no techkey for the object exists. Therefore maybay the handle is needed to identify the object in backend
      Specified by:
      setHandle in interface BusinessObject
      Parameters:
      handle - the handle of business object which identifies the object in the backend, if the techkey still not exists
    • getHandle

      public String getHandle()
      Description copied from interface: BusinessObject
      This method returns the handle, as an alternative key for the business object, because at the creation point no techKey for the object exists. Therefore maybe the handle is needed to identify the object in back end return the handle of business object which is needed to identify the object in the back end, if the techKey still not exists
      Specified by:
      getHandle in interface BusinessObject
      Returns:
      the BO handle
    • hasHandle

      public boolean hasHandle()
      Description copied from interface: BusinessObject
      Returns the information, if a handle for the object exists.
      Specified by:
      hasHandle in interface BusinessObject
      Returns:
      true, if there is a handle false, if the handle is null or if the handle is an empty string.
    • setInvalid

      public void setInvalid()
      Description copied from interface: BusinessObject
      Set the Business Object invalid, no property.
      Specified by:
      setInvalid in interface BusinessObject
    • setValid

      public void setValid()
      Description copied from interface: BusinessObject
      Set the Business Object valid, no property.
      Specified by:
      setValid in interface BusinessObject
    • isValid

      public boolean isValid()
      Description copied from interface: BusinessObject
      Returns if the business object is valid.
      Specified by:
      isValid in interface BusinessObject
      Returns:
      valid
    • addMessage

      public void addMessage(Message message)
      Description copied from interface: MessageListHolder
      Add a message to the message list.
      Specified by:
      addMessage in interface MessageListHolder
      Parameters:
      message - message to add
    • copyMessages

      public void copyMessages(BusinessObjectBase bob)
      Description copied from interface: BusinessObject
      copy the messages from an another BusinessObject and add this to the object.
      Specified by:
      copyMessages in interface BusinessObject
      Parameters:
      bob - reference to a BusinessObjectBase object
    • copyMessages

      public void copyMessages(MessageListHolder messageListHolder)
      Description copied from interface: BusinessObject
      Copy the messages from an another Message list holder and add this to the object.
      Specified by:
      copyMessages in interface BusinessObject
      Parameters:
      messageListHolder - reference to a MessageListHolder object
    • hasMessages

      public boolean hasMessages()
      Description copied from interface: BusinessObject
      Returns if the business object or one of it sub objects has a message.
      Specified by:
      hasMessages in interface BusinessObject
      Returns:
      true, if at least one message exists
    • clearMessages

      public void clearMessages(String resourceKey)
      Description copied from interface: BusinessObject
      Removes all messages with the given key from the list of messages.
      Specified by:
      clearMessages in interface BusinessObject
      Parameters:
      resourceKey - resourceKey of messages
    • hasOwnMessages

      public boolean hasOwnMessages()
      Description copied from interface: BusinessObject
      Returns if the business object itself has a message.
      Specified by:
      hasOwnMessages in interface BusinessObject
      Returns:
      true, if at least one message exists
    • getOwnMessageList

      public MessageList getOwnMessageList()
      Description copied from interface: BusinessObject
      Returns the messages of the Business Object itself.
      Specified by:
      getOwnMessageList in interface BusinessObject
      Returns:
      message list of Business Object without child objects
    • clearMessages

      public void clearMessages()
      Description copied from interface: MessageListHolder
      Clear all messages in the message list.
      Specified by:
      clearMessages in interface MessageListHolder
    • clearOwnMessages

      public void clearOwnMessages()
      Description copied from interface: BusinessObject
      Clears all messages and set state of the Business Object to valid.
      Specified by:
      clearOwnMessages in interface BusinessObject
    • getMessageList

      public MessageList getMessageList()
      Description copied from interface: MessageListHolder
      Returns the messages list object itself. Always the reference of the original object should be provided.
      Specified by:
      getMessageList in interface MessageListHolder
      Returns:
      reference to message list
    • logMessage

      public void logMessage(Message message)
      Description copied from interface: BusinessObject
      Log an message to the IsaLocation of BusinessObject.
      Specified by:
      logMessage in interface BusinessObject
      Parameters:
      message - message to log
    • getSubObjectIterator

      public Iterator<BusinessObjectBase> getSubObjectIterator()
      The method returns an iterator over all sub objects of the BusinessObject.
      Specified by:
      getSubObjectIterator in interface BusinessObject
      Returns:
      Iterator to loop over sub objects
    • addExtensionData

      public void addExtensionData(String key, Object value)
      Description copied from interface: BusinessObject
      This method stores arbitrary data within this Business Object.
      Specified by:
      addExtensionData in interface BusinessObject
      Parameters:
      key - key with which the specified value is to be associated.
      value - value to be associated with the specified key.
    • getExtensionData

      public Object getExtensionData(String key)
      Description copied from interface: BusinessObject
      This method retrieves extension data associated with the Business Object.
      Specified by:
      getExtensionData in interface BusinessObject
      Parameters:
      key - key with which the specified value is to be associated.
      Returns:
      value which is associated with the specified key
    • removeExtensionData

      public void removeExtensionData(String key)
      Description copied from interface: BusinessObject
      This method removes extension data from the Business Object.
      Specified by:
      removeExtensionData in interface BusinessObject
      Parameters:
      key - key of the extension data
    • getExtensionDataValues

      public Set<Map.Entry<String,Object>> getExtensionDataValues()
      Description copied from interface: BusinessObject
      This method retrieves all extension data associated with the Business Object.
      Specified by:
      getExtensionDataValues in interface BusinessObject
      Returns:
      all extension data as entry set
    • removeExtensionDataValues

      public void removeExtensionDataValues()
      Description copied from interface: BusinessObject
      This method removes all extensions data from the Business Object.
      Specified by:
      removeExtensionDataValues in interface BusinessObject
    • setExtensionMap

      public void setExtensionMap(Map<String,Object> extensionData)
      Description copied from interface: BusinessObject
      Sets the extension map to the given map.
      Specified by:
      setExtensionMap in interface BusinessObject
      Parameters:
      extensionData - the new extension HashMap for the object
    • getExtensionMap

      public Map<String,Object> getExtensionMap()
      Description copied from interface: BusinessObject
      Returns the extension map.
      Specified by:
      getExtensionMap in interface BusinessObject
      Returns:
      extensionData, the extension Map of the object
    • getModuleConfigurationAccess

      protected ModuleConfigurationAccess getModuleConfigurationAccess()
      Returns:
      the ModuleConfigurationAccess
    • determineBackendObject

      protected void determineBackendObject(boolean initialize)
      Determines the backend object.
      Parameters:
      initialize - if true, backend object is reset first (works only in determination mode!)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Compares this object to the specified object. The result is true if and only if the argument is not null and is of the same class that has the same technical key ( TechKey) as this object.
      Overrides:
      equals in class Object
      Parameters:
      o - Object to compare with
      Returns:
      true if the objects are identical; otherwiese false.
    • hashCode

      public int hashCode()
      Returns the hash code for this object.
      Overrides:
      hashCode in class Object
      Returns:
      Hash code
    • clone

      public Object clone() throws CloneNotSupportedException
      Makes a copy of the object. The MessageList is copied.
      Overrides:
      clone in class Object
      Returns:
      a copy of object
      Throws:
      CloneNotSupportedException - CloneNotSupportedException