Class StorageRequest
java.lang.Object
de.hybris.platform.odata2services.odata.persistence.AbstractRequest
de.hybris.platform.odata2services.odata.persistence.CrudRequest
de.hybris.platform.odata2services.odata.persistence.StorageRequest
- All Implemented Interfaces:
PersistenceContext
Request which contains an item for persistence.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated, for removal: This API element is subject to removal in a future version.Nested classes/interfaces inherited from class de.hybris.platform.odata2services.odata.persistence.CrudRequest
CrudRequest.DataRequestBuilder<T extends CrudRequest.DataRequestBuilder,R extends CrudRequest> Nested classes/interfaces inherited from class de.hybris.platform.odata2services.odata.persistence.AbstractRequest
AbstractRequest.AbstractRequestBuilder<T extends AbstractRequest.AbstractRequestBuilder,R extends AbstractRequest> -
Method Summary
Modifier and TypeMethodDescriptionRetrieves data acceptLocale associated with the request.Indicates the language, in which localized attributes content is provided.Determines whether the payload item that can be retrieved byPersistenceContext.getIntegrationItem()method has been persisted already in the course of the root persistent context processing and retrieves the persisted item from the context.Retrieves item data to be persisted.Returns name of thePostPersistHookto be executed after saving this context data.Returns name of thePrePersistHookto be executed before saving this context data.getReferencedContext(TypeAttributeDescriptor attribute) Retrieves the persistence context for an item referenced by the specified attributegetReferencedContexts(TypeAttributeDescriptor attribute) Retrieves the persistence contexts for the items referenced by the specified attributeRetrieves the top most persistence contextRetrieves the persistence context that the referenced context was gotten frombooleanDetermines whether a new item model can be created for the context payload.booleanIndicates the persistence is to replace the item attributes with what's provided in theIntegrationItem.voidAdds the item model corresponding to the payload, i.e.Creates aItemSearchRequestfrom thisPersistenceContextDeprecated, for removal: This API element is subject to removal in a future version.replaced withtoItemSearchRequest()Methods inherited from class de.hybris.platform.odata2services.odata.persistence.CrudRequest
getContentType, getIntegrationKey, getODataEntry, getRequestUri, getServiceRoot, setContentType, setIntegrationItem, setIntegrationKey, setODataEntry, setRequestUri, setServiceRootMethods inherited from class de.hybris.platform.odata2services.odata.persistence.AbstractRequest
getEntitySet, getEntitySetReferencedByProperty, getEntityType, getIntegrationObjectCode, getPropertyTypeName, setAcceptLocale, setEntitySet, setEntityType, setIntegrationObjectCode
-
Method Details
-
storageRequestBuilder
-
getIntegrationItem
Description copied from interface:PersistenceContextRetrieves item data to be persisted.- Specified by:
getIntegrationItemin interfacePersistenceContext- Overrides:
getIntegrationItemin classCrudRequest- Returns:
- item data to be persisted into an
ItemModel.
-
getPrePersistHook
Description copied from interface:PersistenceContextReturns name of thePrePersistHookto be executed before saving this context data.- Specified by:
getPrePersistHookin interfacePersistenceContext- Returns:
- name of the hook to execute or
null, if there is no need to execute a hook.
-
getPostPersistHook
Description copied from interface:PersistenceContextReturns name of thePostPersistHookto be executed after saving this context data.- Specified by:
getPostPersistHookin interfacePersistenceContext- Returns:
- name of the hook to execute or
null, if there is no need to execute a hook.
-
getPersistenceContext
-
getAcceptLocale
Description copied from class:AbstractRequestRetrieves data acceptLocale associated with the request.- Specified by:
getAcceptLocalein interfacePersistenceContext- Overrides:
getAcceptLocalein classAbstractRequest- Returns:
- a "Accept-Language" header locale associated with the request.
-
toLookupRequest
@Deprecated(since="2105", forRemoval=true) public ItemLookupRequest toLookupRequest() throws org.apache.olingo.odata2.api.edm.EdmExceptionDeprecated, for removal: This API element is subject to removal in a future version.replaced withtoItemSearchRequest()Creates anItemLookupRequestfrom thisStorageRequest- Returns:
- the newly constructed ItemLookupRequest
- Throws:
org.apache.olingo.odata2.api.edm.EdmException- if encounters an OData problem
-
toItemSearchRequest
Creates aItemSearchRequestfrom thisPersistenceContext- Specified by:
toItemSearchRequestin interfacePersistenceContext- Returns:
- a newly constructed ItemSearchRequest
-
getContentLocale
Description copied from interface:PersistenceContextIndicates the language, in which localized attributes content is provided.- Specified by:
getContentLocalein interfacePersistenceContext- Returns:
- content locale that must be always explicitly specified in this context, so that clients would not need to duplicate logic for determining a locale for the localized attributes in the payload.
-
getReferencedContext
Description copied from interface:PersistenceContextRetrieves the persistence context for an item referenced by the specified attribute- Specified by:
getReferencedContextin interfacePersistenceContext- Parameters:
attribute- specifies referenced item- Returns:
- the context containing information about the referenced item
-
getReferencedContexts
Description copied from interface:PersistenceContextRetrieves the persistence contexts for the items referenced by the specified attribute- Specified by:
getReferencedContextsin interfacePersistenceContext- Parameters:
attribute- specifies referenced items- Returns:
- the context containing information about the referenced items
-
isReplaceAttributes
public boolean isReplaceAttributes()Description copied from interface:PersistenceContextIndicates the persistence is to replace the item attributes with what's provided in theIntegrationItem. This is primarily applicable to collections. The default behavior is to append to the collection. With this method being true, the item's collection attribute will be replaced instead of appended.- Specified by:
isReplaceAttributesin interfacePersistenceContext- Returns:
- true means to replace attributes, otherwise false.
-
isItemCanBeCreated
public boolean isItemCanBeCreated()Description copied from interface:PersistenceContextDetermines whether a new item model can be created for the context payload.- Specified by:
isItemCanBeCreatedin interfacePersistenceContext- Returns:
true, when new item can be create, if an item matching the context was not found in the persistent storage;false, if the context implies update only and therefore the item should not be created, if it does not exist yet.
-
getSourceContext
Description copied from interface:PersistenceContextRetrieves the persistence context that the referenced context was gotten from- Specified by:
getSourceContextin interfacePersistenceContext- Returns:
- parent context, from which this context was retrieved. If this context is the root item context, Optional.empty is returned
-
getContextItem
Description copied from interface:PersistenceContextDetermines whether the payload item that can be retrieved byPersistenceContext.getIntegrationItem()method has been persisted already in the course of the root persistent context processing and retrieves the persisted item from the context. This is the case when a nested item refers back to another item present earlier on the payload graph. For example, an Order contains OrderEntries and OrderEntry refers back to its container Order. The already persisted item match should be done by the item type and its key value. Only when those two characteristics match, the context item was already persisted and can be retrieved by this method.- Specified by:
getContextItemin interfacePersistenceContext- Returns:
- an item, if this persistent context represents an already persisted payload item from higher levels of the root
item graph or an empty
Optional, if the item was not persisted yet. - See Also:
-
putItem
Description copied from interface:PersistenceContextAdds the item model corresponding to the payload, i.e.PersistenceContext.getIntegrationItem(), into this context for being persisted. Every single payload item that is converted to anItemModelmust be put into this context explicitly.- Specified by:
putItemin interfacePersistenceContext
-
getRootContext
Description copied from interface:PersistenceContextRetrieves the top most persistence context- Specified by:
getRootContextin interfacePersistenceContext- Returns:
- the root context
-
StorageRequestBuilderinstead.