Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 57210 invoked from network); 18 Nov 2005 12:23:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Nov 2005 12:23:47 -0000 Received: (qmail 27748 invoked by uid 500); 18 Nov 2005 12:23:47 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 27342 invoked by uid 500); 18 Nov 2005 12:23:45 -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 27331 invoked by uid 99); 18 Nov 2005 12:23:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Nov 2005 04:23:45 -0800 X-ASF-Spam-Status: No, hits=0.3 required=10.0 tests=MAILTO_TO_SPAM_ADDR,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of contactme42@gmail.com designates 64.233.162.204 as permitted sender) Received: from [64.233.162.204] (HELO zproxy.gmail.com) (64.233.162.204) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Nov 2005 04:25:17 -0800 Received: by zproxy.gmail.com with SMTP id x7so170630nzc for ; Fri, 18 Nov 2005 04:23:22 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=XxVUmP09w58AhZiWyroCkO22s7apDoim5kRVJyHNTw8Vr+Hp6CgBX83nZRp8cFF6Rg6WDtvUG5keCG6IU3QgKJdiNw7P9cE/PIqqhwtpft0PzdSweS4aK/mAt13YjkmmavkvlCptMbP4FXxvzmSq+9vCviWrKIyK2VlaGSqv/Lk= Received: by 10.36.216.6 with SMTP id o6mr5802516nzg; Fri, 18 Nov 2005 04:23:22 -0800 (PST) Received: from ?192.168.1.5? ( [203.171.91.153]) by mx.gmail.com with ESMTP id 17sm133108nzo.2005.11.18.04.23.18; Fri, 18 Nov 2005 04:23:22 -0800 (PST) Message-ID: <437DC7C3.4030406@gmail.com> Date: Fri, 18 Nov 2005 23:23:31 +1100 From: Medium User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: user-java@ibatis.apache.org Subject: Re: Reusing resultmap for nested object References: <437ABEBA.3060506@gmail.com> <437C657B.6070703@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Jeff, Thanks for the clarification. I have filed a jira request (IBATIS-225) Anyone who may find this useful, please vote for it. Huy Jeff Butler wrote: > I believe this is because reusing result maps is a feature of the > "groupBy" function, and iBATIS assumes the property will be a > Collection of some kind. So, the real answer is that you can reuse > result maps if your properties are collections. Otherwise not. > > I'm not sure if this is an oversight or "by design" - but it probably > should be fixed/enhanced. You could file a JIRA request to help us > remember. > > Jeff Butler > > On 11/17/05, *Medium* > wrote: > > I tried this, but get the following error. I am using the java version > 2.1.6.589 (Sorry about the long trace). Hoping someone can shed some > light on this. > > Thanks. > > Huy > > > My map is below: > > > > > > > > extends="pickResultMap"> > > > > > > > > > > > > org.springframework.jdbc.UncategorizedSQLException: (SqlMapClient > operation): encountered SQLException [ > --- The error occurred in openlink/dao/ibatis/maps/Pick.xml. > --- The error occurred while applying a result map. > --- Check the Pick.pickJoined. > --- The error happened while setting a property on the result object. > --- Cause: com.ibatis.sqlmap.client.SqlMapException: Error > instantiating > collection property for mapping 'sale'. Cause: > java.lang.ClassCastException > Caused by: java.lang.ClassCastException]; nested exception is > com.ibatis.common.jdbc.exception.NestedSQLException: > --- The error occurred in openlink/dao/ibatis/maps/Pick.xml. > --- The error occurred while applying a result map. > --- Check the Pick.pickJoined. > --- The error happened while setting a property on the result object. > --- Cause: com.ibatis.sqlmap.client.SqlMapException: Error > instantiating > collection property for mapping 'sale'. Cause: > java.lang.ClassCastException > Caused by: java.lang.ClassCastException > com.ibatis.common.jdbc.exception.NestedSQLException: > --- The error occurred in openlink/dao/ibatis/maps/Pick.xml. > --- The error occurred while applying a result map. > --- Check the Pick.pickJoined. > --- The error happened while setting a property on the result object. > --- Cause: com.ibatis.sqlmap.client.SqlMapException: Error > instantiating > collection property for mapping 'sale'. Cause: > java.lang.ClassCastException > Caused by: java.lang.ClassCastException > Caused by: com.ibatis.sqlmap.client.SqlMapException: Error > instantiating > collection property for mapping 'sale'. Cause: > java.lang.ClassCastException > Caused by: java.lang.ClassCastException > at > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:188) > at > > > > Gilles Bayon wrote: > > > This syntax > > > > > > > > > > > > > > is supported . > > > > > > On 11/16/05, *Medium* < contactme42@gmail.com > > > >> > wrote: > > > > Hi, > > > > Is there a way to reuse a resultmap for a nested object ? > > > > I know how to map it as specified by the docs but its > getting a bit > > unwieldly with all the repetition. > > > > Docs: > > > > > > > > column="CAT_ID" /> > > column="CAT_DESCRIPTION" /> > > > > > > Goal: > > > > > > > > > > > > > > > > > > > > > > > > Any help would be greatly appreciated. A simple yah or nah would > > do fine > > as well. > > > > Thanks > > > > Huy > > > > > >