Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 20049 invoked from network); 21 Jul 2007 16:58:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jul 2007 16:58:30 -0000 Received: (qmail 75080 invoked by uid 500); 21 Jul 2007 16:58:30 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 74458 invoked by uid 500); 21 Jul 2007 16:58:29 -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 74447 invoked by uid 99); 21 Jul 2007 16:58:29 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Jul 2007 09:58:29 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=MSGID_FROM_MTA_HEADER,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of fcoexposito@hotmail.com designates 65.54.246.165 as permitted sender) Received: from [65.54.246.165] (HELO bay0-omc2-s29.bay0.hotmail.com) (65.54.246.165) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Jul 2007 09:58:26 -0700 Received: from hotmail.com ([65.55.133.108]) by bay0-omc2-s29.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Sat, 21 Jul 2007 09:58:05 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat, 21 Jul 2007 09:58:05 -0700 Message-ID: Received: from 65.55.133.123 by by128fd.bay128.hotmail.msn.com with HTTP; Sat, 21 Jul 2007 16:58:01 GMT X-Originating-IP: [81.42.238.210] X-Originating-Email: [fcoexposito@hotmail.com] X-Sender: fcoexposito@hotmail.com In-Reply-To: From: "Francisco Exposito Aguilera" To: user-java@ibatis.apache.org Subject: Re: select doubt Date: Sat, 21 Jul 2007 16:58:01 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed X-OriginalArrivalTime: 21 Jul 2007 16:58:05.0490 (UTC) FILETIME=[4E81D120:01C7CBB8] X-Virus-Checked: Checked by ClamAV on apache.org The two changes I�ve done are: the new set method public void setAtrib_ (ArrayList atrib_) {this.atrib_ = atrib_;} and the result property for attributes where Elemento is the namespace of the sqlMap file, but it is in the same sqlMap file as the If I debug the code using a breakpoint in the setAtrib_ method, I obtain when the process arrives to the set method that the parameter atrib_ is null and if I end the execution I get the error: Cause: com.ibatis.sqlmap.client.SqlMapException: There is no result map named elemento.getAtributos in this SqlMap. In order to check if the null is caused for the select getAtributos, I�ve call it directly from the application and it returns the correct values... I�m lost!!! Thanks >From: "Francisco Exposito Aguilera" >Reply-To: user-java@ibatis.apache.org >To: user-java@ibatis.apache.org >Subject: Re: select doubt >Date: Sat, 21 Jul 2007 16:06:18 +0000 > >I�ve checked my code and I think I am doing something wrong in my >resultMap, but I don�t know how to solve it... > > > > > select="getAtributos"/> > > >In my old resultMap I had > > > >and atrib_id is not an ArrayList > >Now I have as property atrib_ which is an ArrayList and it gets the >Attributes with the function getAtributos. But there is no column for this >. > > > >If I put as column ATRIB_ID (which is not an ArrayList), then I >obtain the error > >Error setting property 'setAtrib_' ... Cause: >java.lang.IllegalArgumentException: argument type mismatch > >Any idea? Thanks > > > > > > > >>From: "Jeff Butler" >>Reply-To: user-java@ibatis.apache.org >>To: user-java@ibatis.apache.org >>Subject: Re: select doubt >>Date: Thu, 19 Jul 2007 10:08:58 -0500 >> >>I belive the issue is that your setter isn't quite right. Should be like >>this: >> >>public void setAtrib_ (ArrayList atrib_) {this.atrib_ = atrib_;} >> >>If you do it this way, iBATIS will know to expect multiple values for the >>attributes. >> >>Jeff Butler >> >> >> >> >>On 7/19/07, Francisco Exposito Aguilera wrote: >>> >>>Hello, >>> >>>I have another typical issue of a beginner!!!!! >>> >>>I have two tables: >>> >>>ELEM: id, name, atrib_id >>>ATRIB: id, name, value >>> >>>In Elem java class I�ve defined >>> >>>private ArrayList atrib_ = new ArrayList(); >>>public void setAtrib_ (Atrib atrib) {atrib_.add(atrib);} >>> >>>and in sqlMap I�ve defined: >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>select="getAtributos" >>>/> >>> >>> >>> >>> >>> >>> >>>All this works properly if I have only one attribute for every element, >>>but >>>if there are two attribute for any element, the I obtain the error: >>> >>>Cause: java.sql.SQLException: Error: executeQueryForObject returned too >>>many >>>results. >>> >>>I understand the error, but I am not able to find the solution!!! How >>>could >>>I solve it? Thanks >>> >>> >>> >>> > >_________________________________________________________________ >Un amor, una aventura, compa��a para un viaje. Reg�strate gratis en MSN >Amor & Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349 > _________________________________________________________________ Un amor, una aventura, compa��a para un viaje. Reg�strate gratis en MSN Amor & Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349