I am trying to use selectKey to generate my ID from an Oracle sequence but I
can't figure out the correct usage. Searching on the Internet yields many
tutorials and when I try doing them EXACTLY as they instruct I get errors-
probably due to version differences.

Here's what I'm trying to do:

<selectKey keyProperty="id" resultClass="int">
  SELECT MY_SEQ.nextVal AS id FROM DUAL
</selectKey>
insert into MyTable (my_id, my_value)
values (#id#, #value#)

And I get the error:

Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath
'/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException:
Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath
'/sqlMap/insert'.  Cause: com.ibatis.common.beans.ProbeException: There is
no READABLE property named 'id' in class 'com.mytest.MyTest'

why does it keep trying to load id from the parameter class while ignoring
the selectKey ??
-- 
View this message in context: 
http://www.nabble.com/Can%27t-get-this-selectKey-element-working-tf4846284.html#a13865417
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

Reply via email to