Class DefaultPersistenceService
- java.lang.Object
-
- de.hybris.platform.odata2services.odata.persistence.impl.DefaultPersistenceService
-
- All Implemented Interfaces:
PersistenceService
public class DefaultPersistenceService extends java.lang.Object implements PersistenceService
Default implementation forPersistenceService
-
-
Constructor Summary
Constructors Constructor Description DefaultPersistenceService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.olingo.odata2.api.ep.entry.ODataEntrycreateEntityData(StorageRequest storageRequest)Create or update a commerce suite item and return it as an ODataEntryvoiddeleteItem(ItemLookupRequest lookupRequest)Deletes the item matching the conditions of the specified requestprotected CreateItemStrategygetCreateItemStrategy()ItemLookupResult<org.apache.olingo.odata2.api.ep.entry.ODataEntry>getEntities(ItemLookupRequest lookupRequest, ConversionOptions options)Searches for items matching the conditions of the specified requestorg.apache.olingo.odata2.api.ep.entry.ODataEntrygetEntityData(ItemLookupRequest lookupRequest, ConversionOptions options)Get a commerce suite item as an ODataEntryprotected java.lang.StringgetEntryIntegrationKeyProperty(org.apache.olingo.odata2.api.ep.entry.ODataEntry oDataEntry)protected ModelEntityServicegetModelEntityService()protected ModelServicegetModelService()protected PersistHookExecutorgetPersistHookRegistry()protected SessionServicegetSessionService()protected org.springframework.transaction.support.TransactionTemplategetTransactionTemplate()protected voidpersistModel(java.lang.String postPersistHookName, ItemModel item, java.lang.String integrationKey)protected voidsaveEntities(StorageRequest request)protected voidsaveEntitiesInTransaction(StorageRequest context)voidsetCreateItemStrategy(CreateItemStrategy strategy)voidsetModelEntityService(ModelEntityService service)voidsetModelService(ModelService service)voidsetPersistHookRegistry(PersistHookExecutor registry)voidsetSessionService(SessionService sessionService)voidsetTransactionTemplate(org.springframework.transaction.support.TransactionTemplate transactionTemplate)
-
-
-
Method Detail
-
createEntityData
public org.apache.olingo.odata2.api.ep.entry.ODataEntry createEntityData(StorageRequest storageRequest) throws org.apache.olingo.odata2.api.edm.EdmException
Description copied from interface:PersistenceServiceCreate or update a commerce suite item and return it as an ODataEntry- Specified by:
createEntityDatain interfacePersistenceService- Parameters:
storageRequest- Parameter object that holds values for creating or updating an item.- Returns:
- the ODataEntry that was created or updated
- Throws:
org.apache.olingo.odata2.api.edm.EdmException- when not being able to persist the given info
-
getEntityData
public org.apache.olingo.odata2.api.ep.entry.ODataEntry getEntityData(ItemLookupRequest lookupRequest, ConversionOptions options) throws org.apache.olingo.odata2.api.edm.EdmException
Description copied from interface:PersistenceServiceGet a commerce suite item as an ODataEntry- Specified by:
getEntityDatain interfacePersistenceService- Parameters:
lookupRequest- Parameter object that holds values for getting an item.options- Parameter that indicates options to be used during item conversion.- Returns:
- the ODataEntry that was required
- Throws:
org.apache.olingo.odata2.api.edm.EdmException- when not being able to persist the given info
-
getEntities
public ItemLookupResult<org.apache.olingo.odata2.api.ep.entry.ODataEntry> getEntities(ItemLookupRequest lookupRequest, ConversionOptions options) throws org.apache.olingo.odata2.api.edm.EdmException
Description copied from interface:PersistenceServiceSearches for items matching the conditions of the specified request- Specified by:
getEntitiesin interfacePersistenceService- Parameters:
lookupRequest- specifies what items need to be found and conditions for matching the items existing in the platform.options- Parameter that indicates options to be used during item conversion- Returns:
- result of searching for ODataEntries matching the specified request conditions in the platform
- Throws:
org.apache.olingo.odata2.api.edm.EdmException- when not being able to retrieve the entities
-
deleteItem
public void deleteItem(ItemLookupRequest lookupRequest) throws org.apache.olingo.odata2.api.edm.EdmException
Description copied from interface:PersistenceServiceDeletes the item matching the conditions of the specified request- Specified by:
deleteItemin interfacePersistenceService- Parameters:
lookupRequest- Parameter object that holds values for searching for an item.- Throws:
org.apache.olingo.odata2.api.edm.EdmException- when there was an unexpected odataexception
-
saveEntitiesInTransaction
protected void saveEntitiesInTransaction(StorageRequest context)
-
saveEntities
protected void saveEntities(StorageRequest request)
-
persistModel
protected void persistModel(java.lang.String postPersistHookName, ItemModel item, java.lang.String integrationKey)
-
getEntryIntegrationKeyProperty
protected java.lang.String getEntryIntegrationKeyProperty(org.apache.olingo.odata2.api.ep.entry.ODataEntry oDataEntry)
-
getCreateItemStrategy
protected CreateItemStrategy getCreateItemStrategy()
-
setCreateItemStrategy
public void setCreateItemStrategy(CreateItemStrategy strategy)
-
getModelEntityService
protected ModelEntityService getModelEntityService()
-
setModelEntityService
public void setModelEntityService(ModelEntityService service)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService service)
-
getPersistHookRegistry
protected PersistHookExecutor getPersistHookRegistry()
-
setPersistHookRegistry
public void setPersistHookRegistry(PersistHookExecutor registry)
-
getSessionService
protected SessionService getSessionService()
-
setSessionService
public void setSessionService(SessionService sessionService)
-
getTransactionTemplate
protected org.springframework.transaction.support.TransactionTemplate getTransactionTemplate()
-
setTransactionTemplate
public void setTransactionTemplate(org.springframework.transaction.support.TransactionTemplate transactionTemplate)
-
-