Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 19482 invoked from network); 15 Feb 2007 22:24:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Feb 2007 22:24:20 -0000 Received: (qmail 13300 invoked by uid 500); 15 Feb 2007 22:24:27 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 12878 invoked by uid 500); 15 Feb 2007 22:24:26 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 12867 invoked by uid 99); 15 Feb 2007 22:24:26 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Feb 2007 14:24:26 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Feb 2007 14:24:14 -0800 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1HHp18-0000Er-GS for user-java@ibatis.apache.org; Thu, 15 Feb 2007 14:23:54 -0800 Message-ID: <8995102.post@talk.nabble.com> Date: Thu, 15 Feb 2007 14:23:54 -0800 (PST) From: cmose To: user-java@ibatis.apache.org Subject: RE: parameter map and like %?% query In-Reply-To: <34BBE305D66DBC4D9B525141DCB7D73A0D29188D@tpcexchange.pamperedchef.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: cjmose@gmail.com References: <34BBE305D66DBC4D9B525141DCB7D73A0D29188A@tpcexchange.pamperedchef.com> <34BBE305D66DBC4D9B525141DCB7D73A0D29188D@tpcexchange.pamperedchef.com> X-Virus-Checked: Checked by ClamAV on apache.org Terribly sorry, I didn't read your response closely enough and thought you were doing something else entirely. I had wanted to stay away from doing that in the code but I may just write a typehandlercallback to accomplish it. Thanks much. Todorovich, Milo wrote: > > Map parameterMap = new HashMap(); > > It's just a java.util.Map > > > > -----Original Message----- > From: cmose [mailto:cjmose@gmail.com] > Sent: Thursday, February 15, 2007 4:18 PM > To: user-java@ibatis.apache.org > Subject: RE: parameter map and like %?% query > > > Milo, > thanks for that information - I had hoped to not have to put the > wildcards in the parameter programmatically prior to calling the > statement via sqlmapclient... > > I'm not familiar with getting an instance of the parametermap > programmatically - could you give me a brief pointer to where in the > documentaiton I might find that functionality? Thanks much. > > > > Todorovich, Milo wrote: >> >> Instead of coding the % signs into your statements, make them a part >> of the parameter that is passed in. Here's an example: >> >> >> >> >> Then your code can call this statement like this: >> >> parameterMap.put("nameParm", "%"+nameParmValue+"%"); List results = >> sqlMapClient.queryForList("selectLikeName", >> parameterMap); >> >> >> Good luck! >> -Milo >> >> >> -----Original Message----- >> From: cmose [mailto:cjmose@gmail.com] >> Sent: Thursday, February 15, 2007 4:06 PM >> To: user-java@ibatis.apache.org >> Subject: parameter map and like %?% query >> >> >> I hope this isn't a blatantly obvious question but it may well be... >> >> I'm trying to do a LIKE query using either a parameter map or an >> inline parameter map and I can't seem to get that to work with the % >> and % characters, what I would like to do is something along the lines > >> of LIKE %?% or LIKE %#value#% however, I can't seem to get that >> working. Every time I try it using %?% I get a mysql syntax error >> indicating that ibatis is adding quotes around the %'s e.g,. >> '%'value'%' which causes mysql to barf. >> >> I tried quoting the %?%, e.g., "%?%" but that causes ibatis to barf >> saying that it can't find a parameter... >> >> Does anyone have advice/can point out something obvious that I'm >> missing or is this just not possible? >> >> Thanks! >> -- >> View this message in context: >> http://www.nabble.com/parameter-map-and-like-----query-tf3236388.html# >> a8 >> 994700 >> Sent from the iBATIS - User - Java mailing list archive at Nabble.com. >> >> >> > > -- > View this message in context: > http://www.nabble.com/RE%3A-parameter-map-and-like-----query-tf3236438.h > tml#a8994979 > Sent from the iBATIS - User - Java mailing list archive at Nabble.com. > > > -- View this message in context: http://www.nabble.com/RE%3A-parameter-map-and-like-----query-tf3236438.html#a8995102 Sent from the iBATIS - User - Java mailing list archive at Nabble.com.