Is it possible in ibatis to have more than one selectKey clause in the same insert query?
THERE CAN BE ONLY ONE!
Eventually I have discovered that there can only be one stanza in an ibatis insert stanza.
However I was able to update the second key as follows (I believe this is oracle specific):
<insert id="create" parameterClass="MyObject">
<selectKey keyProperty="id" resultClass="long" type="pre">
<include refid="sequences.myObjectId" />
</selectKey>
INSERT INTO MY_OBJECT_TABLE
(
MY_OBJECT_ID,
MY_SECOND_ID,
...
)
VALUES
)
#id#,
MY_SECOND_ID_SEQUENCE.nextval,
...
)
</insert>
MY_SECOND_ID_SEQUENCE
is the Oracle sequence name that I previously defined.