Search code examples
sap-commerce-cloud

Joining Cart entry and Product Table in Hybris


I am new to floexible search query in hybris I need to delete the cart entries with specific product id- I am using the below query to get the entries

SELECT {products.PK} FROM {Product AS products JOIN CartEntry  AS carts ON {products.PK} = {CartEntry.PRODUCT} } Where {products.PK} ='<PK of the product>'

I keep getting the below exception message.Is there anything i am missing

Exception message: cannot find (visible) type for alias CartEntry within [carts:CartEntry, products:Product]


Solution

  • Try with the following query :

    SELECT {products.PK} FROM {Product AS products JOIN CartEntry  AS carts ON {products.PK} = {carts.product} } Where {products.PK} ='<PK of the product>'
    

    Hope this helps