Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 56430 invoked from network); 10 Dec 2007 23:09:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Dec 2007 23:09:28 -0000 Received: (qmail 25380 invoked by uid 500); 10 Dec 2007 23:09:15 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 25362 invoked by uid 500); 10 Dec 2007 23:09:15 -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 25351 invoked by uid 99); 10 Dec 2007 23:09:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Dec 2007 15:09:15 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jeffgbutler@gmail.com designates 64.233.166.179 as permitted sender) Received: from [64.233.166.179] (HELO py-out-1112.google.com) (64.233.166.179) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Dec 2007 23:08:52 +0000 Received: by py-out-1112.google.com with SMTP id j37so4384799pyc for ; Mon, 10 Dec 2007 15:08:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=emxXuQrF89aiG1yKps4zB4XO7ukui/xVTsPOqiv+rSM=; b=Nk65WMOr3N43hpy0wImT/MY3gO85LGNw6LQ6R81t7+aOzM8ddnOinPXxTsr4ZrNS7zGfcWuH2Ke8ejZ3yNJQPtOJiNfbazSes80ci6Is3YFsUm6RWT+H5UKCWe3qahVNGqXuHpwNGseuYvqJyA6eTGpQWgygNKBuJN2F2QFyXT8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=Na7gXn+LYbxX1CYoXk6UHOM55yfXlG+j7BQPUyXzC72EnnGFm8Fj9rhqV1uoFnEyAhaUBCrb3qhdB1iTEnyooYCBkR2epqdgx4q9JXOwEKungdKehXIwzYD+b7erIVKmKAsDiKrnlZ4dWNN4oBwDXFbhEL1UOHLpozSDkfqmbIo= Received: by 10.115.78.1 with SMTP id f1mr269934wal.1197328128565; Mon, 10 Dec 2007 15:08:48 -0800 (PST) Received: by 10.114.74.9 with HTTP; Mon, 10 Dec 2007 15:08:48 -0800 (PST) Message-ID: Date: Mon, 10 Dec 2007 17:08:48 -0600 From: "Jeff Butler" To: user-java@ibatis.apache.org, lmeadors@apache.org Subject: Re: Strongly Typed Collections? In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_17575_14270148.1197328128569" References: <247259.91773.qm@web54108.mail.re2.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_17575_14270148.1197328128569 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline IIRC you can make your own List implementation with a result object factory. Give it a try to see. Jeff Butler On Dec 10, 2007 4:29 PM, Larry Meadors wrote: > There is currently no way to configure iBATIS to return a different > type of List. > > Larry > > On Dec 10, 2007 3:15 PM, Joshua Kahn wrote: > > > > No, this is a Java question. > > > > I did do that: > > > > In sql-map-config.xml: > > > > > > Any other thoughts? It still seems to want to return a List. > > > > Thanks, > > Josh > > > > > > > > ----- Original Message ---- > > From: Gilles Bayon > > To: user-java@ibatis.apache.org > > Sent: Monday, December 10, 2007 3:02:01 PM > > Subject: Re: Strongly Typed Collections? > > > > I I think you are in the wrong list, you must subscribe/post to the > .net > > list. > > you must use the listClass attribut by setting it as the type alias to > the > > MyModelList type > > > > Cheer, > > Gilles > > > > On Dec 10, 2007 9:21 PM, Joshua Kahn wrote: > > > Forgive me if this is obvious, but I am an iBatis newbie. > > > > > > In my model object, I have a property that is a custom collection: > > > MyModel > > > |-- MyModelList (collection of MyModel objects -- implements > List, > > extends ArrayList) > > > > > > In my SqlMap, I have defined a separate select query to retrieve this > > collection, which returns a List of MyModel objects. This, however, > causes > > an IllegalArgumentException at runtime as the setter is expecting a > > MyModelList and not a List. There is an easy way to code around this, > but I > > am curious if there is a best practice for implementing/mapping this in > > iBatis. > > > > > > How does iBatis handle strongly typed custom collections? (I did find > a > > reference to a SqlMap property "listClass" but it seems to have been > > deprecated in version 2). > > > > > > Thanks, > > > Josh > > > > > > > > > > > > > > > > > > > > > > > > ____________________________________________________________________________________ > > > Never miss a thing. Make Yahoo your home page. > > > http://www.yahoo.com/r/hs > > > > > > > > > > > -- > > Cheers, > > Gilles > > > > Join my network on LinkedIn > > http://www.linkedin.com/in/sellig > > > > > > ________________________________ > > Never miss a thing. Make Yahoo your homepage. > ------=_Part_17575_14270148.1197328128569 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
IIRC you can make your own List implementation with a result object factory.  Give it a try to see.
 
Jeff Butler

On Dec 10, 2007 4:29 PM, Larry Meadors <lmeadors@apache.org> wrote:
There is currently no way to configure iBATIS to return a different
type of List.

Larry

On Dec 10, 2007 3:15 PM, Joshua Kahn <jkahn_117@yahoo.com> wrote:
>
> No, this is a Java question.
>
> I did do that:
>
> In sql-map-config.xml:
> <typeAlias alias="MyModelList" type="mypackage.MyModelList"/>
>
> Any other thoughts?  It still seems to want to return a List.
>
> Thanks,
> Josh
>
>
>
> ----- Original Message ----
> From: Gilles Bayon <ibatis.net@gmail.com>
> To: user-java@ibatis.apache.org
> Sent: Monday, December 10, 2007 3:02:01 PM
> Subject: Re: Strongly Typed Collections?
>
>  I I think you are in the wrong list, you must subscribe/post to the .net
> list.
> you must use the listClass attribut by setting it as the type alias to the
> MyModelList type
>
> Cheer,
> Gilles
>
>  On Dec 10, 2007 9:21 PM, Joshua Kahn < jkahn_117@yahoo.com> wrote:
> > Forgive me if this is obvious, but I am an iBatis newbie.
> >
> > In my model object, I have a property that is a custom collection:
> >    MyModel
> >       |-- MyModelList (collection of MyModel objects -- implements List,
> extends ArrayList)
> >
> > In my SqlMap, I have defined a separate select query to retrieve this
> collection, which returns a List of MyModel objects.  This, however, causes
> an IllegalArgumentException at runtime as the setter is expecting a
> MyModelList and not a List.  There is an easy way to code around this, but I
> am curious if there is a best practice for implementing/mapping this in
> iBatis.
> >
> > How does iBatis handle strongly typed custom collections? (I did find a
> reference to a SqlMap property "listClass" but it seems to have been
> deprecated in version 2).
> >
> > Thanks,
> > Josh
> >
> >
> >
> >
> >
> >
> >
> ____________________________________________________________________________________
> > Never miss a thing.  Make Yahoo your home page.
> > http://www.yahoo.com/r/hs
> >
>
>
>
> --
> Cheers,
> Gilles
>
> Join my network on LinkedIn
> http://www.linkedin.com/in/sellig
>
>
>  ________________________________
> Never miss a thing. Make Yahoo your homepage.

------=_Part_17575_14270148.1197328128569--