Return-Path: Delivered-To: apmail-incubator-ibatis-user-java-archive@www.apache.org Received: (qmail 65170 invoked from network); 3 May 2005 18:53:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 May 2005 18:53:14 -0000 Received: (qmail 28728 invoked by uid 500); 3 May 2005 18:23:18 -0000 Delivered-To: apmail-incubator-ibatis-user-java-archive@incubator.apache.org Received: (qmail 28680 invoked by uid 500); 3 May 2005 18:23:16 -0000 Mailing-List: contact ibatis-user-java-help@incubator.apache.org; run by ezmlm Precedence: bulk Reply-To: ibatis-user-java@incubator.apache.org List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list ibatis-user-java@incubator.apache.org Received: (qmail 28615 invoked by uid 99); 3 May 2005 18:23:15 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of brandon.goodin@gmail.com designates 64.233.170.195 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.195) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 03 May 2005 11:23:13 -0700 Received: by rproxy.gmail.com with SMTP id c16so15366rne for ; Tue, 03 May 2005 11:21:25 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Go9pnsSFiy5QnkS1Ny+lZwy4gVua19ionqmF01OWRF9D62HeOxS4FEz9+olCOzDXb+NunX9QqLBY613mClIR9LNI7HzCBgTO3rWbSHKmiGaN85MfRyJ9nof6uTlaHKF735aZ8IqOZktytXcDe78oGu+8o169iC1EZCQTOe5knRI= Received: by 10.38.74.10 with SMTP id w10mr70588rna; Tue, 03 May 2005 11:21:25 -0700 (PDT) Received: by 10.38.74.62 with HTTP; Tue, 3 May 2005 11:21:25 -0700 (PDT) Message-ID: <2fe5ef5b0505031121675aedeb@mail.gmail.com> Date: Tue, 3 May 2005 12:21:25 -0600 From: Brandon Goodin Reply-To: Brandon Goodin To: ibatis-user-java@incubator.apache.org Subject: Re: Implicit Mapping and Dynamic SQL In-Reply-To: <373399D6389D8C42B4EAD9BE2B6B5C5F024A15A8@tormail01.cihi.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <373399D6389D8C42B4EAD9BE2B6B5C5F024A15A8@tormail01.cihi.ca> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N i believe it was introduced in 2.0.9. You use it by specifying true or fals= e. from the dtd... remapResults (true|false) #IMPLIED On 5/3/05, Jason Hall wrote: > =20 > how do you use this parameter=20 > =20 > =20 > select * from $table$=20 > =20 > =20 > also does it only work for 2.1.0?=20 > =20 > I'm using 2.0.8. > =20 > =20 > -----Original Message----- > From: Larry Meadors [mailto:larry.meadors@gmail.com] > Sent: Tuesday, May 03, 2005 7:48 AM > To: ibatis-user-java@incubator.apache.org > Subject: Re: Implicit Mapping and Dynamic SQL >=20 > =20 >=20 > The remapResults attribute is used if you have a need to dynamically chan= ge > the result map when the statement is called. While this makes the returne= d > data more flexible, the cost is pretty high, so use it with caution. Larr= y >=20 >=20 > =20 > On 5/3/05, Jason Hall wrote:=20 > >=20 > >=20 > >=20 > > Hi, > >=20 > > I use the following sqlMap statement. > >=20 > > > > select * from $table$ > > > >=20 > > In my java code this works > >=20 > > List l =3D queryForList("selectTable","TABLE_A"); > >=20 > >=20 > > but when i do this with same statement id (selectTable) ... > >=20 > > List l =3D queryForList("selectTable","TABLE_A"); > > List l2 =3D queryForList("selectTable","TABLE_B"); > >=20 > > The first queryForList works but the second doesn't. > >=20 > > In the error it complains that columns that are in TABLE_A are not in > > TABLE_B. Well this is obvious. What's happening the columns are not bei= ng > flushed > > "somewhat - i think??" before the next queryForList is executed. > >=20 > > See. I do the following it works with the same table "TABLE_A"... > > List l =3D queryForList("selectTable","TABLE_A"); > > List l2 =3D queryForList("selectTable","TABLE_A"); > >=20 > >=20 > >=20 > >=20 > > This is the error I got when the second queryForList has been executed > (has been modified for > >=20 > > privacy) > >=20 > > com.ibatis.common.jdbc.exception.NestedSQLException: =20 > > --- The error occurred in Table.xml.=20 > > --- The error occurred while applying a result map.=20 > > --- Check the LookupMap.selectLookupTable-AutoResultMap.=20 > > --- Check the result mapping for the 'COLUMN_TABLE_A' property.=20 > > --- Cause: java.sql.SQLException: Column not found > > Caused by: java.sql.SQLException: Column not found > > at > >=20 > > > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryW= ithCallback(GeneralStatem > >=20 > > ent.java:180) > > at > >=20 > > > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryF= orList(GeneralStatement.j > >=20 > > ava:118) > > at > >=20 > > > com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapE= xecutorDelegate.java:626) > > at > >=20 > > > com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapE= xecutorDelegate.java:598) > > at > >=20 > > > com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessio= nImpl.java:107) > > at > com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientI= mpl.java:76) > >=20 > >=20 > > Caused by: > > java.sql.SQLException: Column not found > > at > sun.jdbc.odbc.JdbcOdbcResultSet.findColumn(JdbcOdbcResultSet.java:1790) > > at > sun.jdbc.odbc.JdbcOdbcResultSet.getObject(JdbcOdbcResultSet.java:1683) > > at > com.ibatis.sqlmap.engine.type.ObjectTypeHandler.getResult(ObjectTypeHandl= er.java:35) > > at > >=20 > > > com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getPrimitiveResult= MappingValue(BasicResultM > >=20 > > ap.java:383) > > at > >=20 > > > com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getResults(BasicRe= sultMap.java:207) > > at > com.ibatis.sqlmap.engine.mapping.result.AutoResultMap.getResults(AutoResu= ltMap.java:52) > > at > com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.= java:349) > > at > com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.j= ava:179) > > at > >=20 > > > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQue= ry(GeneralStatement.java: > >=20 > > 200) > > at > >=20 > > > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryW= ithCallback(GeneralStatem > >=20 > > ent.java:168) > > at > >=20 > > > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryF= orList(GeneralStatement.j > >=20 > > ava:118) > > at > >=20 > > > com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapE= xecutorDelegate.java:626) > > at > >=20 > > > com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapE= xecutorDelegate.java:598) > > at > >=20 > > > com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessio= nImpl.java:107) > > at > com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientI= mpl.java:76) > >=20 >=20 >