If you define a global property, you should be able to do something
like this:

 <isEqual compareValue="${TRUCK_ORDER_TYPE}" property="orderType">

You could place the additional values into a Map along with the object
and pass that into the statement:

 map.put("truckOrderType", getTruckOrderTypeValue());
 map.put("orderType", getOrderType());
 
 <isEqual compareValue="truckOrderType" property="orderType">

--- Prashanth Sukumaran <[EMAIL PROTECTED]> wrote:

> Hi All,
>  
> Is it possible to define constants in SqlMap so they can be used in
> the XML tags to test
> isEqual or isNotEqual etc.  If yes from which version of iBatis is
> this feature available.
>  
> I am currently doing this
>  
> <isNotEmpty prepend="AND" property="orderType">
>  <isEqual compareValue="0" property="orderType">
>         DIST_CHNL_ID = '1010' AND SLS_ORD_TYP_CD = 'Z001'
>  </isEqual>
>  <isEqual compareValue="1" property="orderType">
>        DIST_CHNL_ID = '1111'
>  </isEqual>
>  <isEqual compareValue="2" property="orderType">
>        DIST_CHNL_ID = '1021' AND SLS_ORD_TYP_CD = 'Z002'
>  </isEqual>
>  <isEqual compareValue="3" property="orderType">
>        DIST_CHNL_ID = '1025' AND SLS_ORD_TYP_CD = 'Z003''
>  </isEqual>
> </isNotEmpty>
>  
> The 0, 1, 2 and 3 in the compareValue actually mean Truck, Car, Air,
> Ship etc.  Is there a way to define constants for those values so
> they make more sense.
>  
> like 
>  
>  <isEqual compareValue="ORDER_TYPE_AIR" property="orderType">
>   DIST_CHNL_ID = '1010' AND SLS_ORD_TYP_CD = 'Z001'
>  </isEqual>
>  
> where
>  
> ORDER_TYPE_AIR = 0
>  
> Thanks
>  
> Prashanth Sukumaran.
> 
>               
> ---------------------------------
> Yahoo! for Good
>  Click here to donate to the Hurricane Katrina relief effort. 

Reply via email to