Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 86387 invoked from network); 5 Oct 2009 06:23:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Oct 2009 06:23:34 -0000 Received: (qmail 33638 invoked by uid 500); 5 Oct 2009 06:23:33 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 33618 invoked by uid 500); 5 Oct 2009 06:23:33 -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 33610 invoked by uid 99); 5 Oct 2009 06:23:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Oct 2009 06:23:33 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of guyr-ml1@burntmail.com designates 70.87.63.122 as permitted sender) Received: from [70.87.63.122] (HELO mx02.burntmail.com) (70.87.63.122) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Oct 2009 06:23:23 +0000 Received: from pool-71-246-200-220.washdc.fios.verizon.net ([71.246.200.220] helo=[127.0.0.1]) by mx02.burntmail.com with esmtpa (Exim 4.63) (envelope-from ) id 1MugyO-00028Z-0l for user-java@ibatis.apache.org; Mon, 05 Oct 2009 01:23:04 -0500 Message-ID: <4AC990C5.30603@burntmail.com> Date: Mon, 05 Oct 2009 02:23:01 -0400 From: Guy Rouillier User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: user-java@ibatis.apache.org Subject: Re: two parametr in Mapper method References: <1254682800.817517.24647.nullmailer@mail1008.cent> <16178eb10910041434q640c6d34lf9065c6246368695@mail.gmail.com> <4AC95346.6060508@burntmail.com> <16178eb10910041952u5ad70db3ja712c1a7ed7628a4@mail.gmail.com> In-Reply-To: <16178eb10910041952u5ad70db3ja712c1a7ed7628a4@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Antivirus: avast! (VPS 091004-0, 10/04/2009), Outbound message X-Antivirus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org I'm glad to see you are considering allowing multiple parameters. I've found having to bind everything into one is cumbersome. What are you thinking of doing for XML? I'd suggest replacing ParameterType with ParameterList, with the latter a cut and paste from the mapper method. Your example below would look like: parameterList="int offset, int limit" From a programmer's perspective, I'd find the cut and paste easy, and iBatis would have everything it needs to enable named parameters in the SQL. Clinton Begin wrote: > There's no way to introspect on the parameter names. > > So your choices become: > > @Select({"SELECT * FROM send LIMIT #{1}, #{2}"}) > List getAllItems(int offset, int limit); > > ...Or... > > @Select({"SELECT * FROM send LIMIT #{offset}, #{limit}"}) > List getAllItems(@Param("offset") int offset, @Param("limit") int limit); > > Both suck. But we'll probably default to the first, and allow for the > second. > > Gross. > > Clinton > > On Sun, Oct 4, 2009 at 8:00 PM, Guy Rouillier > wrote: > > I'd be curious to understand what the Java limitation is. I would > have thought that with Java 1.5's support of varargs, limitations > such as this would no longer exists. Of course, to use varargs > here, I suppose we'd have to use Object[], which would shoot your > type safety. > > Clinton Begin wrote: > > It's a limitation in Java. However, we are working on a couple > of potential options. But it's not possible to do it the way > you've written it (which is really sad, because it's perfectly > possible in C# and other languages). > > Clinton > > 2009/10/4 Tomáš Procházka >> > > > > Why not supported this? > > @Select({"SELECT * FROM send LIMIT #{offset}, #{limit}"}) > List getAllItems(int offset, int limit); > > > Its limitation of Java or bug in actual version? > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > user-java-unsubscribe@ibatis.apacheorg > > > > > For additional commands, e-mail: > user-java-help@ibatis.apache.org > > > > > > > > -- > Guy Rouillier > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org > > For additional commands, e-mail: user-java-help@ibatis.apache.org > > > -- Guy Rouillier --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org For additional commands, e-mail: user-java-help@ibatis.apache.org