I think in that case it will try and convert the string 'minimumStock' to a value.

On Apr 13, 2009, at 5:39 PM, Stephen Rufle wrote:

I am not sure you need the EntityFieldValue.makeFieldValue('minimumStock').

Could it be

havingCondition =
EntityCondition.makeCondition('availableToPromiseTotal',
EntityOperator.LESS_THAN_EQUAL_TO, 'minimumStock');

which would end up calling
org.ofbiz.entity.condition.EntityCondition.makeCondition(Object,
EntityComparisonOperator, Object)


Joe Eckard wrote:
What is the correct way to create a "having" condition that compares
two fields? For example:

   HAVING available_to_promise_total <= minimum_stock ;

I can use:

   havingCondition =
EntityCondition.makeCondition('availableToPromiseTotal',
EntityOperator.LESS_THAN_EQUAL_TO,
EntityFieldValue.makeFieldValue('minimumStock'));

which works, but I get the following warning:

=-=-=-=-=-=-=-=-= Database type warning in EntityExpr =-=-=-=-=-=-=- =-=
In entity field
[ProductFacilityLocationQuantityTest.availableToPromiseTotal] set the
value passed in [org.ofbiz.entity.condition.EntityFieldValue] is not
compatible with the Java type of the field [java.math.BigDecimal]


Is there a cleaner way to do this type of thing that I am overlooking?


-Joe

--
Stephen P Rufle
[email protected]
H1:480-626-8022
H2:480-802-7173
Yahoo IM: stephen_rufle
AOL IM: stephen1rufle

Reply via email to