ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Narasimha Prasad" <pras...@dbo2.com>
Subject Question on dynamic prepend and using multiple properties
Date Tue, 17 May 2005 04:41:43 GMT
Here is a problem that I am facing.

 

My parameter class has two counts, say countA and countB and I need to use
these in a ‘HAVING’ clause in the sql query.  Both the values could be
empty.

For eg. if they both have values, the query would look like:

 

Select ….

--- from…

where….

HAVING ( countA > 5 and count B < 10 )

 

I tried using nested dynamic clause, but looks like it is not supported.  

<dynamic prepend="HAVING">

 (

   <isNotEmpty property="countA">

     count > #countA#

   </isNotEmpty>       

   

   <dynamic prepend="AND">

     <isNotEmpty property="countB">

       count < #countB#

     </isNotEmpty>       

   </dynamic>

)

</dynamic>

 

Is there any other approach to solve this problem, other than going thru and
checking every combination of countA and countB ?  Any help/suggestion is
appreciated

 

 

Thanks,

Prasad

 


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.9 - Release Date: 5/12/2005
 

Mime
View raw message