Class DefaultModelEntityService
- java.lang.Object
-
- de.hybris.platform.odata2services.odata.persistence.impl.DefaultModelEntityService
-
- All Implemented Interfaces:
ModelEntityService
public class DefaultModelEntityService extends java.lang.Object implements ModelEntityService
Default implementation forModelEntityService
-
-
Constructor Summary
Constructors Constructor Description DefaultModelEntityService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringaddIntegrationKeyToODataEntry(org.apache.olingo.odata2.api.edm.EdmEntitySet entitySet, org.apache.olingo.odata2.api.ep.entry.ODataEntry oDataEntry)Adds the alias value for an item's integrationKey to the oDataEntryintcount(ItemLookupRequest lookupRequest)Counts how many items in the platform match the provided request conditions.protected ItemModelcreateItem(StorageRequest request, CreateItemStrategy createItemStrategy)ItemModelcreateOrUpdateItem(StorageRequest request, CreateItemStrategy createItemStrategy)create or update platform items based on an ODataEntryprotected java.util.List<CreateItemValidator>getCreateItemValidators()protected EntityModelPopulatorgetEntityModelPopulator()protected IntegrationKeyValueGenerator<org.apache.olingo.odata2.api.edm.EdmEntitySet,org.apache.olingo.odata2.api.ep.entry.ODataEntry>getIntegrationKeyValueGenerator()protected ItemModelgetItem(StorageRequest request, CreateItemStrategy createItemStrategy)protected ItemLookupStrategygetItemLookupStrategy()org.apache.olingo.odata2.api.ep.entry.ODataEntrygetODataEntry(ItemConversionRequest conversionRequest)Converts an itemModel into a ODataEntryItemModellookup(ItemLookupRequest lookupRequest)gets an itemModel based on the given information.ItemLookupResult<ItemModel>lookupItems(ItemLookupRequest lookupRequest)Searches for item models matching the conditions in the specified request.protected voidpopulateItem(StorageRequest request, ItemModel item)voidsetCreateItemValidators(java.util.List<CreateItemValidator> createItemValidators)voidsetEntityModelPopulator(EntityModelPopulator entityModelPopulator)voidsetIntegrationKeyValueGenerator(IntegrationKeyValueGenerator<org.apache.olingo.odata2.api.edm.EdmEntitySet,org.apache.olingo.odata2.api.ep.entry.ODataEntry> integrationKeyValueGenerator)voidsetItemLookupStrategy(ItemLookupStrategy itemLookupStrategy)
-
-
-
Method Detail
-
createOrUpdateItem
public ItemModel createOrUpdateItem(StorageRequest request, CreateItemStrategy createItemStrategy) throws org.apache.olingo.odata2.api.edm.EdmException
Description copied from interface:ModelEntityServicecreate or update platform items based on an ODataEntry- Specified by:
createOrUpdateItemin interfaceModelEntityService- Parameters:
request- Parameter object that holds values for creating or updating an item.createItemStrategy- strategy used to create non-existing items- Returns:
- the ItemModel that was created or updated
- Throws:
org.apache.olingo.odata2.api.edm.EdmException- in case there is an OData related issue
-
getItem
protected ItemModel getItem(StorageRequest request, CreateItemStrategy createItemStrategy) throws org.apache.olingo.odata2.api.edm.EdmException
- Throws:
org.apache.olingo.odata2.api.edm.EdmException
-
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
-
addIntegrationKeyToODataEntry
public java.lang.String addIntegrationKeyToODataEntry(org.apache.olingo.odata2.api.edm.EdmEntitySet entitySet, org.apache.olingo.odata2.api.ep.entry.ODataEntry oDataEntry)Description copied from interface:ModelEntityServiceAdds the alias value for an item's integrationKey to the oDataEntry- Specified by:
addIntegrationKeyToODataEntryin interfaceModelEntityService- Parameters:
entitySet- Edmx representation of the itemoDataEntry- request body represented as xml or json- Returns:
- The calculated integration key.
-
lookup
public ItemModel lookup(ItemLookupRequest lookupRequest) throws org.apache.olingo.odata2.api.edm.EdmException
Description copied from interface:ModelEntityServicegets an itemModel based on the given information.- Specified by:
lookupin interfaceModelEntityService- Parameters:
lookupRequest- Parameter object that holds values for getting an itemModel- Returns:
- the itemModel
- Throws:
org.apache.olingo.odata2.api.edm.EdmException- in case there is an OData related issue
-
lookupItems
public ItemLookupResult<ItemModel> lookupItems(ItemLookupRequest lookupRequest) throws org.apache.olingo.odata2.api.edm.EdmException
Description copied from interface:ModelEntityServiceSearches for item models matching the conditions in the specified request.- Specified by:
lookupItemsin interfaceModelEntityService- Parameters:
lookupRequest- Parameter object that holds values for getting an itemModel- Returns:
- result searching item models by the specified request
- Throws:
org.apache.olingo.odata2.api.edm.EdmException- in case there is an OData related issue
-
count
public int count(ItemLookupRequest lookupRequest) throws org.apache.olingo.odata2.api.edm.EdmException
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.
- Throws:
org.apache.olingo.odata2.api.edm.EdmException- in case there is an OData related issue
-
populateItem
protected void populateItem(StorageRequest request, ItemModel item) throws org.apache.olingo.odata2.api.edm.EdmException
- Throws:
org.apache.olingo.odata2.api.edm.EdmException
-
createItem
protected ItemModel createItem(StorageRequest request, CreateItemStrategy createItemStrategy) throws org.apache.olingo.odata2.api.edm.EdmException
- Throws:
org.apache.olingo.odata2.api.edm.EdmException
-
getItemLookupStrategy
protected ItemLookupStrategy getItemLookupStrategy()
-
setItemLookupStrategy
public void setItemLookupStrategy(ItemLookupStrategy itemLookupStrategy)
-
getEntityModelPopulator
protected EntityModelPopulator getEntityModelPopulator()
-
setEntityModelPopulator
public void setEntityModelPopulator(EntityModelPopulator entityModelPopulator)
-
getCreateItemValidators
protected java.util.List<CreateItemValidator> getCreateItemValidators()
-
setCreateItemValidators
public void setCreateItemValidators(java.util.List<CreateItemValidator> createItemValidators)
-
getIntegrationKeyValueGenerator
protected IntegrationKeyValueGenerator<org.apache.olingo.odata2.api.edm.EdmEntitySet,org.apache.olingo.odata2.api.ep.entry.ODataEntry> getIntegrationKeyValueGenerator()
-
setIntegrationKeyValueGenerator
public void setIntegrationKeyValueGenerator(IntegrationKeyValueGenerator<org.apache.olingo.odata2.api.edm.EdmEntitySet,org.apache.olingo.odata2.api.ep.entry.ODataEntry> integrationKeyValueGenerator)
-
-