Re: view-entity subquery WHERE clauses supported?

Posted by Christian Carlow-OFBizzer on
URL: http://ofbiz.116.s1.nabble.com/view-entity-subquery-WHERE-clauses-supported-tp4643984p4643991.html

Watching this https://issues.apache.org/jira/browse/OFBIZ-4781 and will
probably start working on it if no one has solved it yet.  I need to
check the branch to see if it was ever solved there.

On 09/16/2013 03:56 PM, Christian Carlow wrote:

> Conditional joins would also be solution to my problem.  I tried to
> add an entity-condition within the view-entity but it was output as a
> WHERE clause.
>
> Was the issue mentioned here ever resolved?
>
> http://ofbiz.135035.n4.nabble.com/View-Link-Entity-Conditions-td4219210.html 
>
>
> On 09/16/2013 03:16 PM, Christian Carlow wrote:
>> For a little perspective,
>>
>> Essentially what I'm trying to accomplish is a simplified shipping
>> schedule list based on order item ship group due quantities.
>>
>> I created a view-entity that joins together orderHeader, orderItem,
>> orderItemShipGroup, and orderItemshipGroupAssoc.
>>
>> Additionally I created a view entity that joins together itemIssuance
>> and Shipment and joined this view-entity twice to the previous view
>> entity mentioned but created one with a condition where
>> Shipment.statusId = "SHIPMENT_SHIPPED" and the other with a condition
>> where Shipment.statusId = "SHIPMENT_INPUT".
>>
>> I'm trying to get the total amount issued with sum(II.quantity -
>> II.cancelQuantity), which references the second join where
>> Shipment.statusId = "SHIPMENT_INPUT"
>>
>> and the total amount not shipped with MIN(OISGA.quantity) -
>> sum(II.quantity - II.cancelQuantity) which references the first join
>> where Shipment.statusId = "SHIPMENT_SHIPPED"
>>
>> On 09/16/2013 10:57 AM, Christian Carlow wrote:
>>> Does anyone know if it is possible to constrain joined view-entity
>>> subqueries with their own WHERE clauses?
>>>
>>> For example:
>>>
>>> select * from tbl1 left join (select * from tbl2 where tbl2.col1 =
>>> 'someVal') tbl3 on tbl1.col1 = tbl3.col1
>>
>