Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 98743 invoked from network); 1 Dec 2008 23:12:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Dec 2008 23:12:52 -0000 Received: (qmail 63360 invoked by uid 500); 1 Dec 2008 23:12:58 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 63342 invoked by uid 500); 1 Dec 2008 23:12:58 -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 63329 invoked by uid 99); 1 Dec 2008 23:12:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Dec 2008 15:12:58 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [12.154.72.130] (HELO mailgwout.pragmatics.com) (12.154.72.130) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Dec 2008 23:11:30 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C9540A.3433706C" Subject: Referencing iterable fields as properties of a dynamic SQL statement Date: Mon, 1 Dec 2008 18:11:56 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Referencing iterable fields as properties of a dynamic SQL statement Thread-Index: AclUCjRyjDSajk2GRYSF2Z/51r7y0Q== From: "Pieper, Aaron (SAIC)" To: X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. ------_=_NextPart_001_01C9540A.3433706C Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I'm having a problem using iBatis to implement a dynamic SQL query. For this query, the user specifies a list of strings, and they're allowed to specify "null". I want iBatis to query for the records matching the strings they specify. If they specify "null" as one of the list elements, then I want to include null records in my response. My query worked OK until I tried to incorporate the null case. My SQL map with the null case included looks something like this: ------------------------------------------------------------ SELECT * FROM foo WHERE foo.bar=3D#searchCriteria[]# foo.bar is null ------------------------------------------------------------ This produces a NumberFormatException, caused by "searchCriteria[]" being specified as a property. If I change the property to "searchCriteria" (without the braces) instead, then I don't get the exception (but the resulting behavior is incorrect.) This looks very close to the tracker IBATIS-42 (http://issues.apache.org/jira/browse/IBATIS-42) but that particular tracker was marked as fixed in version 2.1.0, and I'm still seeing this problem in 2.1.7.597. Should I submit a new tracker? - Aaron Pieper ------_=_NextPart_001_01C9540A.3433706C Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Referencing iterable fields as properties of a dynamic SQL = statement

Im having a problem = using iBatis to implement a dynamic SQL = query. For = this query, the user specifies a list of strings, and theyre allowed to = specify null. I want iBatis to query for the records matching the strings they = specify. If they specify null as one of the list elements, then I want to = include null = records in my = response.

My query = worked OK until I tried to incorporate the null case. My SQL map with the null case = included looks = something like this:

--------------------------------------------------------= ----

SELECT = *

FROM = foo

WHERE

<iterate = property=3D"searchCriteria" conjunction=3D" OR = ">

        <isNotNull = property=3D"searchCriteria[]">

        =         foo.bar=3D#searchCriteria[]#

        </isNotNull>

        <isNull = property=3D"searchCriteria[]">

        =         foo.bar is null

        </isNull>

</iterate>

--------------------------------------------------------= ----

This = produces a NumberFormatException, caused by searchCriteria[] being specified as a property. If = I change the property to searchCriteria (without the braces) instead, then I dont get the = exception (but = the resulting behavior is incorrect.)

This looks very close to the tracker IBATIS-42 = (http://issues.apache.org/jira/browse/IBATIS-42) but that particular tracker was marked as fixed in = version 2.1.0, and Im still seeing this problem in 2.1.7.597. Should I submit a new tracker?

-       = Aaron Pieper

------_=_NextPart_001_01C9540A.3433706C--