Class DefaultItemLookupStrategy
- java.lang.Object
-
- de.hybris.platform.odata2services.odata.persistence.lookup.DefaultItemLookupStrategy
-
- All Implemented Interfaces:
ItemLookupStrategy
public class DefaultItemLookupStrategy extends java.lang.Object implements ItemLookupStrategy
-
-
Constructor Summary
Constructors Constructor Description DefaultItemLookupStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected FlexibleSearchQuerybuildQuery(FlexibleSearchQueryBuilder builder)protected FlexibleSearchQueryBuilderbuildWhereForKeyNavProperties(FlexibleSearchQueryBuilder queryBuilder, ItemLookupRequest lookupRequest)Deprecated, for removal: This API element is subject to removal in a future version.usebuildWhereForKeyNavProperties(ItemLookupRequest)instead.protected java.util.Map<java.lang.String,java.lang.Object>buildWhereForKeyNavProperties(ItemLookupRequest lookupRequest)intcount(ItemLookupRequest lookupRequest)Counts how many items in the platform match the provided request conditions.protected FlexibleSearchServicegetFlexibleSearchService()protected IntegrationObjectServicegetIntegrationObjectService()protected ItemLookupRequestFactorygetItemLookupRequestFactory()protected booleanisCollectionNavigationPropertyQuery(ItemLookupRequest lookupRequest)ItemModellookup(ItemLookupRequest lookupRequest)Looks for anItemon the commerce suite based on the given information.protected ItemModellookupInternal(ItemLookupRequest lookupRequest)ItemLookupResult<ItemModel>lookupItems(ItemLookupRequest lookupRequest)Looks forItems in the commerce suite based on the given request parameters.protected FlexibleSearchQueryBuilderqueryBuilder(ItemLookupRequest lookupRequest)protected SearchResult<ItemModel>search(FlexibleSearchQueryBuilder builder)protected SearchResult<ItemModel>search(FlexibleSearchQuery query)voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService)voidsetIntegrationObjectService(IntegrationObjectService integrationObjectService)voidsetItemLookupRequestFactory(ItemLookupRequestFactory itemLookupRequestFactory)protected java.util.Map<java.lang.String,java.lang.Object>toMap(org.apache.olingo.odata2.api.ep.entry.ODataEntry oDataEntry)
-
-
-
Method Detail
-
lookup
public ItemModel lookup(ItemLookupRequest lookupRequest) throws org.apache.olingo.odata2.api.edm.EdmException
Description copied from interface:ItemLookupStrategyLooks for anItemon the commerce suite based on the given information.- Specified by:
lookupin interfaceItemLookupStrategy- Parameters:
lookupRequest- request information- Returns:
- an item model matching the request condition, i.e. the integration key value.
- Throws:
org.apache.olingo.odata2.api.edm.EdmException- when request is invalid
-
count
public int count(ItemLookupRequest lookupRequest) throws org.apache.olingo.odata2.api.edm.EdmException
Description copied from interface:ItemLookupStrategyCounts how many items in the platform match the provided request conditions.- Specified by:
countin interfaceItemLookupStrategy- 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- if the request is invalid
-
lookupItems
public ItemLookupResult<ItemModel> lookupItems(ItemLookupRequest lookupRequest) throws org.apache.olingo.odata2.api.edm.EdmException
Description copied from interface:ItemLookupStrategyLooks forItems in the commerce suite based on the given request parameters.- Specified by:
lookupItemsin interfaceItemLookupStrategy- Parameters:
lookupRequest- request information conditions, i.e. type of items to find, page conditions- Returns:
- result of the lookup based on the given criteria
- Throws:
org.apache.olingo.odata2.api.edm.EdmException- when request is invalid
-
lookupInternal
protected ItemModel lookupInternal(ItemLookupRequest lookupRequest) throws org.apache.olingo.odata2.api.edm.EdmException
- Throws:
org.apache.olingo.odata2.api.edm.EdmException
-
search
protected SearchResult<ItemModel> search(FlexibleSearchQueryBuilder builder)
-
search
protected SearchResult<ItemModel> search(FlexibleSearchQuery query)
-
buildQuery
protected FlexibleSearchQuery buildQuery(FlexibleSearchQueryBuilder builder)
-
queryBuilder
protected FlexibleSearchQueryBuilder queryBuilder(ItemLookupRequest lookupRequest) throws org.apache.olingo.odata2.api.edm.EdmException
- Throws:
org.apache.olingo.odata2.api.edm.EdmException
-
isCollectionNavigationPropertyQuery
protected boolean isCollectionNavigationPropertyQuery(ItemLookupRequest lookupRequest)
-
toMap
protected java.util.Map<java.lang.String,java.lang.Object> toMap(org.apache.olingo.odata2.api.ep.entry.ODataEntry oDataEntry)
-
buildWhereForKeyNavProperties
@Deprecated(since="1905.2002-CEP", forRemoval=true) protected FlexibleSearchQueryBuilder buildWhereForKeyNavProperties(FlexibleSearchQueryBuilder queryBuilder, ItemLookupRequest lookupRequest) throws org.apache.olingo.odata2.api.edm.EdmExceptionDeprecated, for removal: This API element is subject to removal in a future version.usebuildWhereForKeyNavProperties(ItemLookupRequest)instead. The parametersMapreturned by this method can be applied to the query builder by callingqueryBuilder.withParameters(buildWhereForKeyNavProperties(lookupRequest))}. This is what current implementation of this method does.- Throws:
org.apache.olingo.odata2.api.edm.EdmException
-
buildWhereForKeyNavProperties
protected java.util.Map<java.lang.String,java.lang.Object> buildWhereForKeyNavProperties(ItemLookupRequest lookupRequest) throws org.apache.olingo.odata2.api.edm.EdmException
- Throws:
org.apache.olingo.odata2.api.edm.EdmException
-
getFlexibleSearchService
protected FlexibleSearchService getFlexibleSearchService()
-
setFlexibleSearchService
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
-
getIntegrationObjectService
protected IntegrationObjectService getIntegrationObjectService()
-
setIntegrationObjectService
public void setIntegrationObjectService(IntegrationObjectService integrationObjectService)
-
getItemLookupRequestFactory
protected ItemLookupRequestFactory getItemLookupRequestFactory()
-
setItemLookupRequestFactory
public void setItemLookupRequestFactory(ItemLookupRequestFactory itemLookupRequestFactory)
-
-