ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dannystommen <da...@techconnect.nl>
Subject Re: <generate> tag not working
Date Thu, 03 Sep 2009 09:25:25 GMT

Michael, did you manage to take a look at it?


Michael McCurrey-3 wrote:
> 
> I'll take a look at it tonight Danny.  Stay tuned.
> 
> On Wed, Sep 2, 2009 at 12:02 AM, dannystommen <danny@techconnect.nl>
> wrote:
> 
>>
>> Where can 1.6.3 be found? On ibatis.apache.org I can only find 1.6.2. I
>> upgraded to this version. Still doesn't work
>>
>> My XML
>> <?xml version="1.0" encoding="UTF-8"?>
>> <sqlMap namespace="Test" xmlns="http://ibatis.apache.org/mapping"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="http://ibatis.apache.org/mapping ../Config/SqlMap.xsd
>> ">
>>   <resultMaps>
>>    <resultMap id="TestResult" class="Test">
>>      <result property="ID" column="id" />
>>      <result property="Name" column="name" />
>>    </resultMap>
>>  </resultMaps>
>>
>>  <parameterMaps>
>>    <parameterMap id="insert" class="Test">
>>       <paramater property="Name" column="name" />
>>     </parameterMap>
>>
>>    <parameterMap id="update" class="Test" extends="insert">
>>       <paramater property="ID" column="id" />
>>    </parameterMap>
>>  </parameterMaps>
>>
>>
>>  <statements>
>>     <insert id="Insert" parameterMap="insert">
>>      <selectKey property="ID" type="post" resultClass="int">
>>        select LAST_INSERT_ID() as value
>>      </selectKey>
>>      <generate table="test_table" />
>>    </insert>
>>
>>    <update id="Update" parameterMap="update">
>>       <generate table="test_table" by="id"></generate>
>>    </update>
>>
>>  </statements>
>> </sqlMap>
>>
>>
>>
>>
>> Michael McCurrey-3 wrote:
>> >
>> > Can you update to 1.6.3 and see if it works, if not, send me your
>> updated
>> > map file and I'll take a look.  Did you change the <result for both
>> your
>> > insert and your update map?
>> >
>> >
>> > On Tue, Sep 1, 2009 at 8:18 AM, dannystommen <danny@techconnect.nl>
>> wrote:
>> >
>> >>
>> >> Version 1.6.1
>> >>
>> >>
>> >> Michael McCurrey-3 wrote:
>> >> >
>> >> > What version of iBatis?
>> >> >
>> >> > On Tue, Sep 1, 2009 at 8:12 AM, dannystommen <danny@techconnect.nl>
>> >> 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:
>> >> >> >    <parameterMap id="insert" class="Test">
>> >> >> >      <result property="Name" column="name" />
>> >> >> >    </parameterMap>
>> >> >> >
>> >> >> > Try this:
>> >> >> >    <parameterMap id="insert" class="Test">
>> >> >> >      <parameter property="Name" column="name" />
>> >> >> >    </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 colums:
>> id
>> >> &
>> >> >> name
>> >> >> >>
>> >> >> >>  <resultMaps>
>> >> >> >>    <resultMap id="TestResult" class="Test">
>> >> >> >>      <result property="ID" column="id" />
>> >> >> >>      <result property="Name" column="name" />
>> >> >> >>    </resultMap>
>> >> >> >>  </resultMaps>
>> >> >> >>
>> >> >> >>  <parameterMaps>
>> >> >> >>    <parameterMap id="insert" class="Test">
>> >> >> >>      <result property="Name" column="name" />
>> >> >> >>    </parameterMap>
>> >> >> >>
>> >> >> >>    <parameterMap id="update" class="Test" extends="insert">
>> >> >> >>      <result property="ID" column="id" />
>> >> >> >>    </parameterMap>
>> >> >> >>  </parameterMaps>
>> >> >> >>
>> >> >> >>  <statements>
>> >> >> >>    <!--Insert description-->
>> >> >> >>    <insert id="Insert" parameterMap="insert">
>> >> >> >>      <selectKey property="ID" type="post" resultClass="int">
>> >> >> >>        select LAST_INSERT_ID() as value
>> >> >> >>      </selectKey>
>> >> >> >>      <generate table="test_table" />
>> >> >> >>    </insert>
>> >> >> >>
>> >> >> >>    <update id="Update" parameterMap="update">
>> >> >> >>      <generate table="test_table" by="id" />
>> >> >> >>    </update>
>> >> >> >>
>> >> >> >>  </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\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/
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/%3Cgenerate%3E-tag-not-working-tp25240019p25242269.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-tp25240019p25252614.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-tp25240019p25272516.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


Mime
View raw message