ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prashanth Sukumaran <prashanthsukuma...@yahoo.com>
Subject Define Constants in SQLMap
Date Wed, 14 Sep 2005 17:15:41 GMT
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. 
Mime
View raw message