ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: selectKey and parameterMap issue
Date Thu, 17 Aug 2006 15:58:33 GMT
It does work with parameterMaps.  I have a test case working now:

<parameterMap id="insertParameterMap" class="test.Animal">
  <parameter property="id"/>
  <parameter property="type"/>
</parameterMap>

<insert id="insertWithSelectKey" parameterMap="insertParameterMap">
  <selectKey keyProperty="id">
    select max(animalId) + 1 from Animal
  </selectKey>
  insert into Animal (animalId, animalType) values(?, ?)
</insert>

I don't know why this is different from what you're doing.  Are you on a
pretty recent version of iBATIS?  I'm testing against 2.2.0.  The only thing
I noticed wierd in your map was different data types (long and DECIMAL).
But it seems like you would be getting an Exception if that was the problem.

Jeff Butler


On 8/17/06, jaybytez <jaybytez@gmail.com> wrote:
>
>
> So does selectKey only work with parameterClass?
>
> I have tried a million different configurations and cannot get selectKey
> and
> parameterMap to work.
>
> Thanks for your help!
>
> jay
> --
> View this message in context: http://www.nabble.com/selectKey-and-parameterMap-issue-tf2118776.html#a5853887
>
> Sent from the iBATIS - User - Java forum at Nabble.com<http://nabble.com/>
> .
>
>

Mime
View raw message