Anyone know a way to apply condition to view-entity and then left join to another view-entity?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Anyone know a way to apply condition to view-entity and then left join to another view-entity?

Christian Carlow-OFBizzer
Does anyone know a way to apply a condition to a view-entity and then
left join it to another view-entity?

I need to be able to apply a condition to the OrderShipment entity where
shipmentId = parameters.shipmentId and then left join this conditioned
view-entity to another view-entity.

I couldn't figure out how to do it with DynamicViewEntity.
Reply | Threaded
Open this post in threaded view
|

Re: Anyone know a way to apply condition to view-entity and then left join to another view-entity?

Todd Thorner
I'm very new to OFbiz and very rusty at MVC programming (haven't done
any since Struts 1.x), but I bumped into this page when I was
researching ecommerce front-ends:
http://www.magentocommerce.com/boards/viewthread/33703/

Not sure if that has anything to do with what you're trying to
accomplish, but I thought I'd try pretending to help.  As people might
be able to guess, I'm quite lost so far.


Todd

P.S. to everyone on the board: I hope to learn enough about OFbiz to
pitch in with documentation.  I have 15+ years experience as a tech
writer, mostly doing API docs for SDK products.  At the rate I'm getting
up to speed, it shouldn't take me more than a few years...



On 13-10-30 08:56 AM, Christian Carlow wrote:
> Does anyone know a way to apply a condition to a view-entity and then
> left join it to another view-entity?
>
> I need to be able to apply a condition to the OrderShipment entity where
> shipmentId = parameters.shipmentId and then left join this conditioned
> view-entity to another view-entity.
>
> I couldn't figure out how to do it with DynamicViewEntity.
Reply | Threaded
Open this post in threaded view
|

Re: Anyone know a way to apply condition to view-entity and then left join to another view-entity?

Christian Carlow-OFBizzer
Hey Todd,

Thanks for trying to help but your link is specific to Magento and it
doesn't cover the problem I face.

I need to be able to apply a condition to the OrderShipment where
OrderShipment.shipmentId = parameters.shipmentId which might product
this query:
SELECT * FROM ORDER_SHIPMENT WHERE SHIPMENT_ID = '10000';

Then I need to be able to left join that query to another to produce
something like this:

SELECT * FROM ORDER_ITEM_SHIP_GROUP_ASSOC OISGA LEFT JOIN (SELECT * FROM
ORDER_SHIPMENT WHERE SHIPMENT_ID = '10000') OS ON OISGA.ORDER_ID =
OS.ORDER_ID AND OISGA.ORDER_ITEM_SEQ_ID = OS.ORDER_ITEM_SEQ_ID AND
OISGA.SHIP_GROUP_SEQ_ID = OS.SHIP_GROUP_SEQ_ID

Anyone know if this is possible?  If not I'll create an Improvement
Issue on JIRA to add such functionality.

On 10/30/2013 11:36 AM, Todd Thorner wrote:

> I'm very new to OFbiz and very rusty at MVC programming (haven't done
> any since Struts 1.x), but I bumped into this page when I was
> researching ecommerce front-ends:
> http://www.magentocommerce.com/boards/viewthread/33703/
>
> Not sure if that has anything to do with what you're trying to
> accomplish, but I thought I'd try pretending to help.  As people might
> be able to guess, I'm quite lost so far.
>
>
> Todd
>
> P.S. to everyone on the board: I hope to learn enough about OFbiz to
> pitch in with documentation.  I have 15+ years experience as a tech
> writer, mostly doing API docs for SDK products.  At the rate I'm getting
> up to speed, it shouldn't take me more than a few years...
>
>
>
> On 13-10-30 08:56 AM, Christian Carlow wrote:
>> Does anyone know a way to apply a condition to a view-entity and then
>> left join it to another view-entity?
>>
>> I need to be able to apply a condition to the OrderShipment entity where
>> shipmentId = parameters.shipmentId and then left join this conditioned
>> view-entity to another view-entity.
>>
>> I couldn't figure out how to do it with DynamicViewEntity.

Reply | Threaded
Open this post in threaded view
|

Re: Anyone know a way to apply condition to view-entity and then left join to another view-entity?

Christian Carlow-OFBizzer
It seems like WHERE clauses should be able to be associated with an
entity/view-entity other than in find methods such as findByAnd or
findListIteratorByCondition. This would allow the where clause to be
applied to the query without the query being executed.  Once the where
clauses are applied, the find method could be used.

Does anyone know if EntityCondition can be associated with an Entity
without the query being executed?


On 10/30/2013 11:53 AM, Christian Carlow wrote:

> Hey Todd,
>
> Thanks for trying to help but your link is specific to Magento and it
> doesn't cover the problem I face.
>
> I need to be able to apply a condition to the OrderShipment where
> OrderShipment.shipmentId = parameters.shipmentId which might product
> this query:
> SELECT * FROM ORDER_SHIPMENT WHERE SHIPMENT_ID = '10000';
>
> Then I need to be able to left join that query to another to produce
> something like this:
>
> SELECT * FROM ORDER_ITEM_SHIP_GROUP_ASSOC OISGA LEFT JOIN (SELECT *
> FROM ORDER_SHIPMENT WHERE SHIPMENT_ID = '10000') OS ON OISGA.ORDER_ID
> = OS.ORDER_ID AND OISGA.ORDER_ITEM_SEQ_ID = OS.ORDER_ITEM_SEQ_ID AND
> OISGA.SHIP_GROUP_SEQ_ID = OS.SHIP_GROUP_SEQ_ID
>
> Anyone know if this is possible?  If not I'll create an Improvement
> Issue on JIRA to add such functionality.
>
> On 10/30/2013 11:36 AM, Todd Thorner wrote:
>> I'm very new to OFbiz and very rusty at MVC programming (haven't done
>> any since Struts 1.x), but I bumped into this page when I was
>> researching ecommerce front-ends:
>> http://www.magentocommerce.com/boards/viewthread/33703/
>>
>> Not sure if that has anything to do with what you're trying to
>> accomplish, but I thought I'd try pretending to help.  As people might
>> be able to guess, I'm quite lost so far.
>>
>>
>> Todd
>>
>> P.S. to everyone on the board: I hope to learn enough about OFbiz to
>> pitch in with documentation.  I have 15+ years experience as a tech
>> writer, mostly doing API docs for SDK products.  At the rate I'm getting
>> up to speed, it shouldn't take me more than a few years...
>>
>>
>>
>> On 13-10-30 08:56 AM, Christian Carlow wrote:
>>> Does anyone know a way to apply a condition to a view-entity and then
>>> left join it to another view-entity?
>>>
>>> I need to be able to apply a condition to the OrderShipment entity
>>> where
>>> shipmentId = parameters.shipmentId and then left join this conditioned
>>> view-entity to another view-entity.
>>>
>>> I couldn't figure out how to do it with DynamicViewEntity.
>

Reply | Threaded
Open this post in threaded view
|

How to sort by foreign table column

xxshutong
Hi Guys,
I have a list page with form as bellow:
<service service-name="performFind" result-map="result" result-map-list="listIt">
          <field-map field-name="inputFields" from-field="inputCtx"/>
          <field-map field-name="entityName" value="InventoryInput"/>
          <field-map field-name="orderBy" value="productId"/>
          <field-map field-name="viewIndex" from-field="viewIndex"/>
          <field-map field-name="viewSize" from-field="viewSize"/>
</service>

productId is a foreign key, how can I sort by a foreign column.
like <field-map field-name="orderBy" value="product.name"/> can not work.

Thanks,
Leon.Zhou
Reply | Threaded
Open this post in threaded view
|

Re: How to sort by foreign table column

xxshutong
I know I can do it with java. But I have many pages like this. I don't want to code so much for many pages just for sorting.

Thanks,
Leon.Zhou

On Nov 2, 2013, at 11:55 AM, xxshutong <[hidden email]> wrote:

> Hi Guys,
> I have a list page with form as bellow:
> <service service-name="performFind" result-map="result" result-map-list="listIt">
>           <field-map field-name="inputFields" from-field="inputCtx"/>
>           <field-map field-name="entityName" value="InventoryInput"/>
>           <field-map field-name="orderBy" value="productId"/>
>           <field-map field-name="viewIndex" from-field="viewIndex"/>
>           <field-map field-name="viewSize" from-field="viewSize"/>
> </service>
>
> productId is a foreign key, how can I sort by a foreign column.
> like <field-map field-name="orderBy" value="product.name"/> can not work.
>
> Thanks,
> Leon.Zhou