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
Base implementation for business object interface.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BackendBusinessObjectBackend Object reference.protected StringBackend type.protected MessageListBusiness Object messages.protected intBusiness Object state.Extension data map.protected GenericFactoryGeneric Factory to create data container beans.protected StringTemporary handle.protected ModuleConfigurationAccessAccess to module configuration data.protected TechKeyTechnical key.Fields inherited from interface de.hybris.platform.sap.core.common.message.MessageListHolder
INVALID, VALID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtensionData(String key, Object value) This method stores arbitrary data within this Business Object.voidaddMessage(Message message) Add a message to the message list.voidClear all messages in the message list.voidclearMessages(String resourceKey) Removes all messages with the given key from the list of messages.voidClears all messages and set state of the Business Object to valid.clone()Makes a copy of the object.voidcopy the messages from an another BusinessObject and add this to the object.voidcopyMessages(MessageListHolder messageListHolder) Copy the messages from an another Message list holder and add this to the object.voidThis method creates a unique handle, as an alternative key for the business object, because at the creation point no techkey for the object exists.voiddestroy()This method is called before the bean is invalidated It needs to be defined in the Spring bean definition as destroy-method.protected voiddetermineBackendObject(boolean initialize) Determines the backend object.booleanCompares this object to the specified object.Returns the backend business object.getBackendBusinessObject(boolean initialize) Returns the backend business object.Get the current backend type.getExtensionData(String key) This method retrieves extension data associated with the Business Object.This method retrieves all extension data associated with the Business Object.Returns the extension map.This method returns the handle, as an alternative key for the business object, because at the creation point no techKey for the object exists.Returns the messages list object itself.protected ModuleConfigurationAccessReturns theModuleConfigurationAccess.Returns the messages of the Business Object itself.The method returns an iterator over all sub objects of the BusinessObject.Retrieves the key for the object.booleanReturns the information, if a handle for the object exists.inthashCode()Returns the hash code for this object.booleanReturns if the business object or one of it sub objects has a message.booleanReturns if the business object itself has a message.voidinit()This method is called after all properties have been set It needs to be defined in the Spring bean definition as init-method.booleanisValid()Returns if the business object is valid.voidlogMessage(Message message) Log an message to the IsaLocation of BusinessObject.voidThis method removes extension data from the Business Object.voidThis method removes all extensions data from the Business Object.voidsetBackendObject(BackendBusinessObject backendObject) Set the current backend business object (optional).voidsetBackendType(String backendType) Set the current backend type.voidsetExtensionMap(Map<String, Object> extensionData) Sets the extension map to the given map.voidsetGenericFactory(GenericFactory genericFactory) Injection setter forGenericFactory.voidThis method sets the handle, as an alternative key for the business object, because at the creation point no techkey for the object exists.voidSet the Business Object invalid, no property.voidsetModuleConfigurationAccess(ModuleConfigurationAccess moduleConfigurationAccess) Injection setter forModuleConfigurationAccess.voidsetTechKey(TechKey techKey) Sets the key for the document.voidsetValid()Set the Business Object valid, no property.toString()
-
Field Details
-
techKey
Technical key. -
handle
Temporary handle. -
bobMessages
Business Object messages. -
bobState
protected int bobStateBusiness Object state. -
extensionData
Extension data map. -
backendType
Backend type. -
backendObject
Backend Object reference. -
genericFactory
Generic Factory to create data container beans. -
moduleConfigurationAccess
Access to module configuration data.
-
-
Constructor Details
-
BusinessObjectBase
public BusinessObjectBase()Standard constructor.
-
-
Method Details
-
setGenericFactory
Injection setter forGenericFactory.- Parameters:
genericFactory-GenericFactory
-
setModuleConfigurationAccess
Injection setter forModuleConfigurationAccess.- Parameters:
moduleConfigurationAccess- theModuleConfigurationAccessto set
-
setBackendObject
Set the current backend business object (optional).- Parameters:
backendObject- the backend business object to use
-
setBackendType
Set the current backend type.- Parameters:
backendType- backend type
-
init
public void init()Description copied from interface:BusinessObjectThis method is called after all properties have been set It needs to be defined in the Spring bean definition as init-method.- Specified by:
initin interfaceBusinessObject
-
destroy
public void destroy()Description copied from interface:BusinessObjectThis method is called before the bean is invalidated It needs to be defined in the Spring bean definition as destroy-method.- Specified by:
destroyin interfaceBusinessObject
-
getBackendType
Get the current backend type.- Returns:
- backend type
-
getBackendBusinessObject
Description copied from interface:BackendAwareReturns the backend business object.- Specified by:
getBackendBusinessObjectin interfaceBackendAware- Returns:
- backend business object
- Throws:
BackendException-BackendException
-
getBackendBusinessObject
Description copied from interface:BackendAwareReturns the backend business object.- Specified by:
getBackendBusinessObjectin interfaceBackendAware- Parameters:
initialize- if true, backend object is re-created- Returns:
- backend business object
- Throws:
BackendException-BackendException
-
getTechKey
Description copied from interface:BusinessObjectRetrieves the key for the object.- Specified by:
getTechKeyin interfaceBusinessObject- Returns:
- The object's key
-
setTechKey
Description copied from interface:BusinessObjectSets the key for the document.- Specified by:
setTechKeyin interfaceBusinessObject- Parameters:
techKey- Key to be set
-
createUniqueHandle
public void createUniqueHandle()Description copied from interface:BusinessObjectThis 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:
createUniqueHandlein interfaceBusinessObject
-
setHandle
Description copied from interface:BusinessObjectThis 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:
setHandlein interfaceBusinessObject- Parameters:
handle- the handle of business object which identifies the object in the backend, if the techkey still not exists
-
getHandle
Description copied from interface:BusinessObjectThis 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:
getHandlein interfaceBusinessObject- Returns:
- the BO handle
-
hasHandle
public boolean hasHandle()Description copied from interface:BusinessObjectReturns the information, if a handle for the object exists.- Specified by:
hasHandlein interfaceBusinessObject- Returns:
- true, if there is a handle false, if the handle is
nullor if the handle is an empty string.
-
setInvalid
public void setInvalid()Description copied from interface:BusinessObjectSet the Business Object invalid, no property.- Specified by:
setInvalidin interfaceBusinessObject
-
setValid
public void setValid()Description copied from interface:BusinessObjectSet the Business Object valid, no property.- Specified by:
setValidin interfaceBusinessObject
-
isValid
public boolean isValid()Description copied from interface:BusinessObjectReturns if the business object is valid.- Specified by:
isValidin interfaceBusinessObject- Returns:
- valid
-
addMessage
Description copied from interface:MessageListHolderAdd a message to the message list.- Specified by:
addMessagein interfaceMessageListHolder- Parameters:
message- message to add
-
copyMessages
Description copied from interface:BusinessObjectcopy the messages from an another BusinessObject and add this to the object.- Specified by:
copyMessagesin interfaceBusinessObject- Parameters:
bob- reference to aBusinessObjectBaseobject
-
copyMessages
Description copied from interface:BusinessObjectCopy the messages from an another Message list holder and add this to the object.- Specified by:
copyMessagesin interfaceBusinessObject- Parameters:
messageListHolder- reference to aMessageListHolderobject
-
hasMessages
public boolean hasMessages()Description copied from interface:BusinessObjectReturns if the business object or one of it sub objects has a message.- Specified by:
hasMessagesin interfaceBusinessObject- Returns:
true, if at least one message exists
-
clearMessages
Description copied from interface:BusinessObjectRemoves all messages with the given key from the list of messages.- Specified by:
clearMessagesin interfaceBusinessObject- Parameters:
resourceKey- resourceKey of messages
-
hasOwnMessages
public boolean hasOwnMessages()Description copied from interface:BusinessObjectReturns if the business object itself has a message.- Specified by:
hasOwnMessagesin interfaceBusinessObject- Returns:
true, if at least one message exists
-
getOwnMessageList
Description copied from interface:BusinessObjectReturns the messages of the Business Object itself.- Specified by:
getOwnMessageListin interfaceBusinessObject- Returns:
- message list of Business Object without child objects
-
clearMessages
public void clearMessages()Description copied from interface:MessageListHolderClear all messages in the message list.- Specified by:
clearMessagesin interfaceMessageListHolder
-
clearOwnMessages
public void clearOwnMessages()Description copied from interface:BusinessObjectClears all messages and set state of the Business Object to valid.- Specified by:
clearOwnMessagesin interfaceBusinessObject
-
getMessageList
Description copied from interface:MessageListHolderReturns the messages list object itself. Always the reference of the original object should be provided.- Specified by:
getMessageListin interfaceMessageListHolder- Returns:
- reference to message list
-
logMessage
Description copied from interface:BusinessObjectLog an message to the IsaLocation of BusinessObject.- Specified by:
logMessagein interfaceBusinessObject- Parameters:
message- message to log
-
getSubObjectIterator
The method returns an iterator over all sub objects of the BusinessObject.- Specified by:
getSubObjectIteratorin interfaceBusinessObject- Returns:
- Iterator to loop over sub objects
-
addExtensionData
Description copied from interface:BusinessObjectThis method stores arbitrary data within this Business Object.- Specified by:
addExtensionDatain interfaceBusinessObject- Parameters:
key- key with which the specified value is to be associated.value- value to be associated with the specified key.
-
getExtensionData
Description copied from interface:BusinessObjectThis method retrieves extension data associated with the Business Object.- Specified by:
getExtensionDatain interfaceBusinessObject- Parameters:
key- key with which the specified value is to be associated.- Returns:
- value which is associated with the specified key
-
removeExtensionData
Description copied from interface:BusinessObjectThis method removes extension data from the Business Object.- Specified by:
removeExtensionDatain interfaceBusinessObject- Parameters:
key- key of the extension data
-
getExtensionDataValues
Description copied from interface:BusinessObjectThis method retrieves all extension data associated with the Business Object.- Specified by:
getExtensionDataValuesin interfaceBusinessObject- Returns:
- all extension data as entry set
-
removeExtensionDataValues
public void removeExtensionDataValues()Description copied from interface:BusinessObjectThis method removes all extensions data from the Business Object.- Specified by:
removeExtensionDataValuesin interfaceBusinessObject
-
setExtensionMap
Description copied from interface:BusinessObjectSets the extension map to the given map.- Specified by:
setExtensionMapin interfaceBusinessObject- Parameters:
extensionData- the new extension HashMap for the object
-
getExtensionMap
Description copied from interface:BusinessObjectReturns the extension map.- Specified by:
getExtensionMapin interfaceBusinessObject- Returns:
- extensionData, the extension Map of the object
-
getModuleConfigurationAccess
Returns theModuleConfigurationAccess.- 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
-
equals
Compares this object to the specified object. The result istrueif and only if the argument is notnulland is of the same class that has the same technical key (TechKey) as this object. -
hashCode
public int hashCode()Returns the hash code for this object. -
clone
Makes a copy of the object. The MessageList is copied.- Overrides:
clonein classObject- Returns:
- a copy of object
- Throws:
CloneNotSupportedException-CloneNotSupportedException
-