Class DefaultModelEntityService
java.lang.Object
de.hybris.platform.odata2services.odata.persistence.impl.DefaultModelEntityService
- All Implemented Interfaces:
ContextItemModelService,ContextReferencedItemModelService,ModelEntityService
public class DefaultModelEntityService
extends Object
implements ModelEntityService, ContextItemModelService, ContextReferencedItemModelService
Default implementation for
ModelEntityService-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcount(ItemLookupRequest lookupRequest) Counts how many items in the platform match the provided request conditions.deriveItemsReferencedInAttributeValue(PersistenceContext context, TypeAttributeDescriptor attribute) Deprecated, for removal: This API element is subject to removal in a future version.deriveReferencedItemModel(TypeAttributeDescriptor attribute, PersistenceContext referencedItemContext) Deprecated, for removal: This API element is subject to removal in a future version.findOrCreateItem(PersistenceContext context) Deprecated, for removal: This API element is subject to removal in a future version.protected EntityModelPopulatorprotected ItemModelPopulatorDeprecated, for removal: This API element is subject to removal in a future version.not used anymore in this service implementation.protected ItemTypeDescriptorServiceDeprecated, for removal: This API element is subject to removal in a future version.not used anymore by this service implementation.protected IntegrationKeyValueGenerator<TypeDescriptor,org.apache.olingo.odata2.api.ep.entry.ODataEntry> protected ModelServiceDeprecated, for removal: This API element is subject to removal in a future version.not used anymore in this service implementation.org.apache.olingo.odata2.api.ep.entry.ODataEntrygetODataEntry(ItemConversionRequest conversionRequest) Converts an itemModel into a ODataEntryprotected voidpopulateItem(StorageRequest request, ItemModel item) Deprecated, for removal: This API element is subject to removal in a future version.not used anymore; will be removedvoidsetContextItemModelService(ContextItemModelService contextItemModelService) Deprecated, for removal: This API element is subject to removal in a future version.not used anymore by this service implementation.voidsetContextReferencedItemModelService(ContextReferencedItemModelService contextReferencedItemModelService) Deprecated, for removal: This API element is subject to removal in a future version.not used anymore by this service implementation.voidsetEntityModelPopulator(EntityModelPopulator entityModelPopulator) Deprecated, for removal: This API element is subject to removal in a future version.not used anymore in this service implementation.voidsetItemModelPopulator(ItemModelPopulator populator) voidsetItemPersistRequestValidators(List<ItemPersistRequestValidator> itemPersistRequestValidators) Deprecated, for removal: This API element is subject to removal in a future version.not used anymore.voidsetItemTypeDescriptorService(ItemTypeDescriptorService itemTypeDescriptorService) Deprecated, for removal: This API element is subject to removal in a future version.not used anymore by this service implementation.voidsetKeyValueGenerator(IntegrationKeyValueGenerator<TypeDescriptor, org.apache.olingo.odata2.api.ep.entry.ODataEntry> keyValueGenerator) voidsetModelService(ModelService modelService) Deprecated, for removal: This API element is subject to removal in a future version.not used anymore in this service implementation.voidsetPersistenceContextValidators(List<PersistenceContextValidator> persistenceContextValidators) Deprecated, for removal: This API element is subject to removal in a future version.not used anymore.voidsetSearchService(ItemSearchService service)
-
Constructor Details
-
DefaultModelEntityService
public DefaultModelEntityService()
-
-
Method Details
-
deriveItemsReferencedInAttributeValue
@Deprecated(since="21.05.0-RC1", forRemoval=true) public Collection<ItemModel> deriveItemsReferencedInAttributeValue(PersistenceContext context, TypeAttributeDescriptor attribute) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ContextReferencedItemModelServiceDerives a collection ofItemModels referenced by the specified attribute in the item payload present in the provided persistence context.- Specified by:
deriveItemsReferencedInAttributeValuein interfaceContextReferencedItemModelService- Parameters:
context- a persistence context containing information about the item being persisted.attribute- an attribute in the context item payload referencing a collection of items to be derived.- Returns:
- a collection of items corresponding to the values of the specified attribute in
PersistenceContext.getIntegrationItem()or an empty collection, if the payload either does not contain the attribute or the attribute value in the payload is empty ornull. Found items are already updated with the values from their payloads.
-
deriveReferencedItemModel
@Deprecated(since="21.05.0-RC1", forRemoval=true) public ItemModel deriveReferencedItemModel(TypeAttributeDescriptor attribute, PersistenceContext referencedItemContext) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ContextReferencedItemModelServiceUsing the context derives an existingItemModelthat is referenced in the payload of the item to be persisted.- Specified by:
deriveReferencedItemModelin interfaceContextReferencedItemModelService- Parameters:
attribute- an attribute that represents the relationship between the item model and the referenced item model that will be derived.referencedItemContext- a persistence context containing information about the item to be found or, in other words, payload of the item to be resolved and converted to anItemModel.- Returns:
- an item specified by
PersistenceContext.getIntegrationItem()ornull, if such item does not exist in the platform. If the item is found, then it's already updated with the values from thereferencedItemContext.
-
findOrCreateItem
@Deprecated(since="21.05.0-RC1", forRemoval=true) public ItemModel findOrCreateItem(PersistenceContext context) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ContextItemModelServiceUsing the context searches for anItemModelexisting in context or in the platform; if not found creates a new item model from the information available in the context. This method should be used when creating a new item for the root or nested integration item is desired in cases when the item was not found.- Specified by:
findOrCreateItemin interfaceContextItemModelService- Parameters:
context- a persistence context containing information about the item to be persisted.- Returns:
- an item specified by
PersistenceContext.getIntegrationItem(). It may be an item existing in the platform or a new item instance, if such item does not exist yet. In either case the item is already updated/populated with values provided in thecontext.
-
getODataEntry
public org.apache.olingo.odata2.api.ep.entry.ODataEntry getODataEntry(ItemConversionRequest conversionRequest) throws org.apache.olingo.odata2.api.edm.EdmException Description copied from interface:ModelEntityServiceConverts an itemModel into a ODataEntry- Specified by:
getODataEntryin interfaceModelEntityService- Parameters:
conversionRequest- Parameter object that holds values for getting an ODataEntry- Returns:
- The ODataEntry representation
- Throws:
org.apache.olingo.odata2.api.edm.EdmException- in case there is an OData related issue
-
count
Description copied from interface:ModelEntityServiceCounts how many items in the platform match the provided request conditions.- Specified by:
countin interfaceModelEntityService- Parameters:
lookupRequest- a request specifying an item type, at a minimum, and possibly other conditions. For example, the request may point to the objects nested in the request's base item type and referred by the navigation segments.- Returns:
- number of items in the platform matching the request conditions.
-
populateItem
@Deprecated(since="2205", forRemoval=true) protected void populateItem(StorageRequest request, ItemModel item) Deprecated, for removal: This API element is subject to removal in a future version.not used anymore; will be removed- Parameters:
request- a request from which the item needs to be populated.item- an item to populate
-
setSearchService
-
getEntityModelPopulator
-
setEntityModelPopulator
@Deprecated(since="2205", forRemoval=true) public void setEntityModelPopulator(EntityModelPopulator entityModelPopulator) Deprecated, for removal: This API element is subject to removal in a future version.not used anymore in this service implementation.- Parameters:
entityModelPopulator- a populator implementation to use.
-
getItemModelPopulator
Deprecated, for removal: This API element is subject to removal in a future version.not used anymore in this service implementation. -
setItemModelPopulator
-
getModelService
Deprecated, for removal: This API element is subject to removal in a future version.not used anymore in this service implementation. -
setModelService
Deprecated, for removal: This API element is subject to removal in a future version.not used anymore in this service implementation.- Parameters:
modelService- a model service implementation to use
-
getKeyValueGenerator
protected IntegrationKeyValueGenerator<TypeDescriptor,org.apache.olingo.odata2.api.ep.entry.ODataEntry> getKeyValueGenerator() -
setKeyValueGenerator
public void setKeyValueGenerator(IntegrationKeyValueGenerator<TypeDescriptor, org.apache.olingo.odata2.api.ep.entry.ODataEntry> keyValueGenerator) -
getItemTypeDescriptorService
@Deprecated(since="2205", forRemoval=true) protected ItemTypeDescriptorService getItemTypeDescriptorService()Deprecated, for removal: This API element is subject to removal in a future version.not used anymore by this service implementation. -
setItemTypeDescriptorService
@Deprecated(since="2205", forRemoval=true) public void setItemTypeDescriptorService(ItemTypeDescriptorService itemTypeDescriptorService) Deprecated, for removal: This API element is subject to removal in a future version.not used anymore by this service implementation.- Parameters:
itemTypeDescriptorService- service implementation to use
-
setPersistenceContextValidators
@Deprecated(since="2205", forRemoval=true) public void setPersistenceContextValidators(List<PersistenceContextValidator> persistenceContextValidators) Deprecated, for removal: This API element is subject to removal in a future version.not used anymore. UseDefaultContextItemModelService, in which the validators are used.- Parameters:
persistenceContextValidators- validators to use
-
setItemPersistRequestValidators
@Deprecated(since="2205", forRemoval=true) public void setItemPersistRequestValidators(List<ItemPersistRequestValidator> itemPersistRequestValidators) Deprecated, for removal: This API element is subject to removal in a future version.not used anymore. UseDefaultContextItemModelService, in which the validators are used.- Parameters:
itemPersistRequestValidators- validators to use
-
setContextReferencedItemModelService
@Deprecated(since="2205", forRemoval=true) public void setContextReferencedItemModelService(ContextReferencedItemModelService contextReferencedItemModelService) Deprecated, for removal: This API element is subject to removal in a future version.not used anymore by this service implementation.- Parameters:
contextReferencedItemModelService- service implementation to use
-
setContextItemModelService
@Deprecated(since="2205", forRemoval=true) public void setContextItemModelService(ContextItemModelService contextItemModelService) Deprecated, for removal: This API element is subject to removal in a future version.not used anymore by this service implementation.- Parameters:
contextItemModelService- service implementation to use
-
DefaultContextReferencedItemModelService.deriveItemsReferencedInAttributeValue(PersistenceContext, TypeAttributeDescriptor)