step one is created a viewentity for the equivalent Select
then use the entity condition for the viewenitity
snowc sent the following on 8/17/2009 10:26 AM:
> I have some legacy data that I am trying to access in ofbiz.
>
> <entity name="E1">
> <field name="e1ID"/>
> <field name="actualNetAmount"/>
> <field name="estimatedNetAmount"/>
> </entity>
>
> Conceptually, I want to filter as shown here:
>
> SELECT e1Id, actualNetAmount, estimatedNetAmount
> FROM E1 WHERE actualNetAmount > estimatedNetAmount
>
> <entity-condition entity="E1">
> <condition-expr field="actualNetAmount" operator="greater"
> value="${this.estimatedNetAmount}"/>
> </entity-condition>
>
> How can I achieve the equivalent of "this" is a entity condition expression?
>
> I do not want to filter by iterating the list as the data volumes are huge.
>
> One option I am thinking of is to create a SQL view and use that to filter
> the data:
>
> SELECT
> e1Id, actualNetAmount, estimatedNetAmount,
> CASE
> WHEN actualNetAmount > estimatedNetAmount THEN 1
> ELSE 0
> END CASE AS actualGTEstimated
> FROM E1
>
> Maybe I could use DynamicViewEntities, but I was trying to use less
> beanshell/java and more minilang.
>
> Many thanks in advance, Chris
>
--
BJ Freeman
http://www.businessesnetwork.com/automationhttp://bjfreeman.elance.comhttp://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_proSystems Integrator.