Return-Path: Delivered-To: apmail-ibatis-user-cs-archive@www.apache.org Received: (qmail 10576 invoked from network); 1 Sep 2009 15:16:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Sep 2009 15:16:45 -0000 Received: (qmail 8651 invoked by uid 500); 1 Sep 2009 15:16:45 -0000 Delivered-To: apmail-ibatis-user-cs-archive@ibatis.apache.org Received: (qmail 8631 invoked by uid 500); 1 Sep 2009 15:16:45 -0000 Mailing-List: contact user-cs-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-cs@ibatis.apache.org Delivered-To: mailing list user-cs@ibatis.apache.org Received: (qmail 8623 invoked by uid 99); 1 Sep 2009 15:16:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Sep 2009 15:16:45 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mmccurrey@gmail.com designates 209.85.210.203 as permitted sender) Received: from [209.85.210.203] (HELO mail-yx0-f203.google.com) (209.85.210.203) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Sep 2009 15:16:34 +0000 Received: by yxe41 with SMTP id 41so52743yxe.27 for ; Tue, 01 Sep 2009 08:16:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=P9CVGHtytPR741HQLGFzVaf59Q8MicbfmCmQPDc7oYU=; b=foehJ2v6Rkn0wvXDrTzQ0Efx4gmTRw0r3E/nDU55VvM9m6FadwYvfAIabHAoTIUQe8 gthAADwAtNAHd2sAS3VDUiFL1C3eR8XcMJU46w86YHtQaPFfuX1SxC50oT0tgUe/6gwf GF4zQd4n65CvMSVpxvch72DjeT+0dzE2WRac4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=f2wejw0vkgRc3ZtQFbrpI2A/ZdAOJsneLUBLPW738U9gHlLgS4P9s/x1dmygmeYq9f mU+rpE2/5JqGoRv5zChtD8JrPPvb/eq8Ut7+7UhchaUaJSXfK016rxaDBwptB0oETrWD edqL2yg1s2+dwv1wdx1nxQJq51+hORPWKN4as= MIME-Version: 1.0 Received: by 10.150.101.5 with SMTP id y5mr11886470ybb.85.1251818172377; Tue, 01 Sep 2009 08:16:12 -0700 (PDT) Reply-To: michael@mccurrey.com In-Reply-To: <25242101.post@talk.nabble.com> References: <25240019.post@talk.nabble.com> <25242101.post@talk.nabble.com> Date: Tue, 1 Sep 2009 08:16:12 -0700 Message-ID: Subject: Re: tag not working From: Michael McCurrey To: user-cs@ibatis.apache.org Content-Type: multipart/alternative; boundary=000e0cd68d207ce9a4047285a1dd X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd68d207ce9a4047285a1dd Content-Type: text/plain; charset=ISO-8859-1 What version of iBatis? On Tue, Sep 1, 2009 at 8:12 AM, dannystommen wrote: > > Thanks for your fast reply. I changed it, but the result is still the same > incorrect sql statement > > > Michael McCurrey-3 wrote: > > > > Well, > > > > One thing I notice that is wrong is your using a result element in your > > parameter Maps. > > > > Instead of this: > > > > > > > > > > Try this: > > > > > > > > > > > > On Tue, Sep 1, 2009 at 6:07 AM, dannystommen > wrote: > > > >> > >> Hi there, > >> > >> I'm trying to use parameterMaps with the tag, but it is not > >> working. I have a databse with table 'test_table' and 2 colums: id & > name > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> select LAST_INSERT_ID() as value > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> the first error occurs when I try to configure Ibatis (first use). > >> "Specified argument was out of the range of valid values.\r\nParameter > >> name: > >> index". This happens in de update tag. When I comment this generate tag > >> out, > >> the configuration succeeds. Why is this happening, I don't have any > >> parameter that is named 'index'. > >> > >> Secondly, when I try to execute the insert statement, it fails with the > >> message dat column 'name' has no default value. After some debugging, I > >> saw > >> that ibatis generated the next insert statement: "INSERT INTO test_table > >> () > >> VALUES ()", while it should be: "INSERT INTO test_table (name) VALUES > >> (something_here?)" > >> > >> Why is this happening? > >> > >> > >> -- > >> View this message in context: > >> > http://www.nabble.com/%3Cgenerate%3E-tag-not-working-tp25240019p25240019.html > >> Sent from the iBATIS - User - Cs mailing list archive at Nabble.com. > >> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: user-cs-unsubscribe@ibatis.apache.org > >> For additional commands, e-mail: user-cs-help@ibatis.apache.org > >> > >> > > > > > > -- > > Michael J. McCurrey > > Read with me at http://www.mccurrey.com > > http://chaoticmindramblings.blogspot.com/ > > > > > > -- > View this message in context: > http://www.nabble.com/%3Cgenerate%3E-tag-not-working-tp25240019p25242101.html > Sent from the iBATIS - User - Cs mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-cs-unsubscribe@ibatis.apache.org > For additional commands, e-mail: user-cs-help@ibatis.apache.org > > -- Michael J. McCurrey Read with me at http://www.mccurrey.com http://chaoticmindramblings.blogspot.com/ --000e0cd68d207ce9a4047285a1dd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable What version of iBatis?

On Tue, Sep 1, 20= 09 at 8:12 AM, dannystommen <danny@techconnect.nl> wrote:

Thanks for your fast reply. I changed it, but the result is still the same<= br> incorrect sql statement


Michael McCurrey-3 wrote:
>
> Well,
>
> One thing I notice that is wrong is your using a result element in you= r
> parameter Maps.
>
> Instead of this:
> =A0 =A0<parameterMap id=3D"insert" class=3D"Test&quo= t;>
> =A0 =A0 =A0<result property=3D"Name" column=3D"name&= quot; />
> =A0 =A0</parameterMap>
>
> Try this:
> =A0 =A0<parameterMap id=3D"insert" class=3D"Test&quo= t;>
> =A0 =A0 =A0<parameter property=3D"Name" column=3D"na= me" />
> =A0 =A0</parameterMap>
>
>
> On Tue, Sep 1, 2009 at 6:07 AM, dannystommen <danny@techconnect.nl> wrote:
>
>>
>> Hi there,
>>
>> I'm trying to use parameterMaps with the <generate> tag,= but it is not
>> working. I have a databse with table 'test_table' and 2 co= lums: id & name
>>
>> =A0<resultMaps>
>> =A0 =A0<resultMap id=3D"TestResult" class=3D"Tes= t">
>> =A0 =A0 =A0<result property=3D"ID" column=3D"id&= quot; />
>> =A0 =A0 =A0<result property=3D"Name" column=3D"n= ame" />
>> =A0 =A0</resultMap>
>> =A0</resultMaps>
>>
>> =A0<parameterMaps>
>> =A0 =A0<parameterMap id=3D"insert" class=3D"Test= ">
>> =A0 =A0 =A0<result property=3D"Name" column=3D"n= ame" />
>> =A0 =A0</parameterMap>
>>
>> =A0 =A0<parameterMap id=3D"update" class=3D"Test= " extends=3D"insert">
>> =A0 =A0 =A0<result property=3D"ID" column=3D"id&= quot; />
>> =A0 =A0</parameterMap>
>> =A0</parameterMaps>
>>
>> =A0<statements>
>> =A0 =A0<!--Insert description-->
>> =A0 =A0<insert id=3D"Insert" parameterMap=3D"ins= ert">
>> =A0 =A0 =A0<selectKey property=3D"ID" type=3D"po= st" resultClass=3D"int">
>> =A0 =A0 =A0 =A0select LAST_INSERT_ID() as value
>> =A0 =A0 =A0</selectKey>
>> =A0 =A0 =A0<generate table=3D"test_table" />
>> =A0 =A0</insert>
>>
>> =A0 =A0<update id=3D"Update" parameterMap=3D"upd= ate">
>> =A0 =A0 =A0<generate table=3D"test_table" by=3D"= id" />
>> =A0 =A0</update>
>>
>> =A0</statements>
>> </sqlMap>
>>
>> the first error occurs when I try to configure Ibatis (first use).=
>> "Specified argument was out of the range of valid values.\r\n= Parameter
>> name:
>> index". This happens in de update tag. When I comment this ge= nerate tag
>> out,
>> the configuration succeeds. Why is this happening, I don't hav= e any
>> parameter that is named 'index'.
>>
>> Secondly, when I try to execute the insert statement, it fails wit= h the
>> message dat column 'name' has no default value. After some= debugging, I
>> saw
>> that ibatis generated the next insert statement: "INSERT INTO= test_table
>> ()
>> VALUES ()", while it should be: "INSERT INTO test_table = (name) VALUES
>> (something_here?)"
>>
>> Why is this happening?
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/%3Cgenerate= %3E-tag-not-working-tp25240019p25240019.html
>> Sent from the iBATIS - User - Cs mailing list archive at Nabble.co= m.
>>
>>
>> ------------------------------------------------------------------= ---
>> To unsubscribe, e-mail: user-cs-unsubscribe@ibatis.apache.org
>> For additional commands, e-mail: user-cs-help@ibatis.apache.org
>>
>>
>
>
> --
> Michael J. McCurrey
> Read with me at = http://www.mccurrey.com
> http://chaoticmindramblings.blogspot.com/
>
>

--
View this message in context: http://www.n= abble.com/%3Cgenerate%3E-tag-not-working-tp25240019p25242101.html
Sent from the iBATIS - User - Cs m= ailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-cs-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-cs-help@ibatis.apache.org




--
Michael J. = McCurrey
Read with me at http://www.= mccurrey.com
h= ttp://chaoticmindramblings.blogspot.com/
--000e0cd68d207ce9a4047285a1dd--