ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From filepillow <filepil...@yahoo.com>
Subject Re: Is this possible in Dynamic SQL
Date Tue, 22 May 2007 02:00:25 GMT
Thanks for your help, Jeff! 

With Regards,

Jeff Butler <jeffgbutler@gmail.com> wrote: As you've seen, iBATIS won't do this (there's
only a single pass through resolving the SQL statement).  You could write your statement like
 select * from $TABLES$ $where_clause$ #abc#
  HashMap map = new HashMap();
    map.put("TABLES", "USER_FORMS");
    map.put("where_clause", "where FormName like");
    map.put("abc", "%edit%"); 
    List list = userSvc.dynamicSearch(map);
 If you want to be completely general, then you'll need to account for many different possibilities.
 Take a look at the code generated by Abator - it is an example of how to code any arbitray
where clause with dynamic SQL. 
 Jeff Butler

Be a better Globetrotter. Get better travel answers from someone who knows.
Yahoo! Answers - Check it out.
View raw message