Hi. I have this view-entity:

  <view-entity entity-name="OrderItemGroupByProduct"
package-name="ph.ati.ofbiz.order">
    <member-entity entity-alias="ORIT" entity-name="OrderItem"/>
    <alias name="orderId" entity-alias="ORIT" group-by="true"/>
    <alias name="productId" entity-alias="ORIT" group-by="true"/>
    <alias name="quantity" entity-alias="ORIT" group-by="true"
function="sum"/>
    <relation type="one" rel-entity-name="OrderHeader">
      <key-map field-name="orderId" />
    </relation>
    <relation type="one" rel-entity-name="Product">
      <key-map field-name="productId" />
    </relation>
  </view-entity>

What I wanted to have is a row containing the sum of quantity ordered for
each productId and orderId.
The error comes from calling 'arraySize = (int)
delegator.findCountByCondition(entityName, condition, null, null);'
when it is executing this sql:
'SELECT COUNT(1) FROM (SELECT COUNT(1) FROM public.ORDER_ITEM ORIT GROUP BY
ORIT.ORDER_ID, ORIT.PRODUCT_ID, SUM(ORIT.QUANTITY)) TEMP_NAME'
How should I make the view-entity?

~ ian

Reply via email to